xrootd
XrdClFile.hh
Go to the documentation of this file.
1//------------------------------------------------------------------------------
2// Copyright (c) 2011-2014 by European Organization for Nuclear Research (CERN)
3// Author: Lukasz Janyst <ljanyst@cern.ch>
4//------------------------------------------------------------------------------
5// This file is part of the XRootD software suite.
6//
7// XRootD is free software: you can redistribute it and/or modify
8// it under the terms of the GNU Lesser General Public License as published by
9// the Free Software Foundation, either version 3 of the License, or
10// (at your option) any later version.
11//
12// XRootD is distributed in the hope that it will be useful,
13// but WITHOUT ANY WARRANTY; without even the implied warranty of
14// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15// GNU General Public License for more details.
16//
17// You should have received a copy of the GNU Lesser General Public License
18// along with XRootD. If not, see <http://www.gnu.org/licenses/>.
19//
20// In applying this licence, CERN does not waive the privileges and immunities
21// granted to it by virtue of its status as an Intergovernmental Organization
22// or submit itself to any jurisdiction.
23//------------------------------------------------------------------------------
24
25#ifndef __XRD_CL_FILE_HH__
26#define __XRD_CL_FILE_HH__
27
31#include <stdint.h>
32#include <string>
33#include <vector>
34#include <sys/uio.h>
35
36namespace XrdCl
37{
38 class FileStateHandler;
39 class FilePlugIn;
40
41 //----------------------------------------------------------------------------
43 //----------------------------------------------------------------------------
44 class File
45 {
46 public:
47
49 {
52 };
53
54 //------------------------------------------------------------------------
56 //------------------------------------------------------------------------
57 File( bool enablePlugIns = true );
58
59 //------------------------------------------------------------------------
61 //------------------------------------------------------------------------
62 File( VirtRedirect virtRedirect, bool enablePlugIns = true );
63
64 //------------------------------------------------------------------------
66 //------------------------------------------------------------------------
67 virtual ~File();
68
69 //------------------------------------------------------------------------
79 //------------------------------------------------------------------------
80 XRootDStatus Open( const std::string &url,
81 OpenFlags::Flags flags,
82 Access::Mode mode,
83 ResponseHandler *handler,
84 uint16_t timeout = 0 )
86
87 //------------------------------------------------------------------------
96 //------------------------------------------------------------------------
97 XRootDStatus Open( const std::string &url,
98 OpenFlags::Flags flags,
99 Access::Mode mode = Access::None,
100 uint16_t timeout = 0 )
102
103 //------------------------------------------------------------------------
110 //------------------------------------------------------------------------
112 uint16_t timeout = 0 )
114
115 //------------------------------------------------------------------------
121 //------------------------------------------------------------------------
123
124 //------------------------------------------------------------------------
134 //------------------------------------------------------------------------
135 XRootDStatus Stat( bool force,
136 ResponseHandler *handler,
137 uint16_t timeout = 0 )
139
140 //------------------------------------------------------------------------
148 //------------------------------------------------------------------------
149 XRootDStatus Stat( bool force,
150 StatInfo *&response,
151 uint16_t timeout = 0 )
153
154
155 //------------------------------------------------------------------------
168 //------------------------------------------------------------------------
169 XRootDStatus Read( uint64_t offset,
170 uint32_t size,
171 void *buffer,
172 ResponseHandler *handler,
173 uint16_t timeout = 0 )
175
176 //------------------------------------------------------------------------
186 //------------------------------------------------------------------------
187 XRootDStatus Read( uint64_t offset,
188 uint32_t size,
189 void *buffer,
190 uint32_t &bytesRead,
191 uint16_t timeout = 0 )
193
194 //------------------------------------------------------------------------
207 //------------------------------------------------------------------------
208 XRootDStatus Write( uint64_t offset,
209 uint32_t size,
210 const void *buffer,
211 ResponseHandler *handler,
212 uint16_t timeout = 0 )
214
215 //------------------------------------------------------------------------
228 //------------------------------------------------------------------------
229 XRootDStatus Write( uint64_t offset,
230 uint32_t size,
231 const void *buffer,
232 uint16_t timeout = 0 )
234
235 //------------------------------------------------------------------------
242 //------------------------------------------------------------------------
244 uint16_t timeout = 0 )
246
247
248 //------------------------------------------------------------------------
254 //------------------------------------------------------------------------
255 XRootDStatus Sync( uint16_t timeout = 0 ) XRD_WARN_UNUSED_RESULT;
256
257 //------------------------------------------------------------------------
265 //------------------------------------------------------------------------
266 XRootDStatus Truncate( uint64_t size,
267 ResponseHandler *handler,
268 uint16_t timeout = 0 )
270
271
272 //------------------------------------------------------------------------
279 //------------------------------------------------------------------------
280 XRootDStatus Truncate( uint64_t size,
281 uint16_t timeout = 0 )
283
284 //------------------------------------------------------------------------
300 //------------------------------------------------------------------------
302 void *buffer,
303 ResponseHandler *handler,
304 uint16_t timeout = 0 )
306
307 //------------------------------------------------------------------------
323 //------------------------------------------------------------------------
325 void *buffer,
326 VectorReadInfo *&vReadInfo,
327 uint16_t timeout = 0 )
329
330 //------------------------------------------------------------------------
338 //------------------------------------------------------------------------
340 ResponseHandler *handler,
341 uint16_t timeout = 0 )
343
344 //------------------------------------------------------------------------
351 //------------------------------------------------------------------------
353 uint16_t timeout = 0 )
355
356 //------------------------------------------------------------------------
366 //------------------------------------------------------------------------
367 XRootDStatus WriteV( uint64_t offset,
368 const struct iovec *iov,
369 int iovcnt,
370 ResponseHandler *handler,
371 uint16_t timeout = 0 );
372
373 //------------------------------------------------------------------------
383 //------------------------------------------------------------------------
384 XRootDStatus WriteV( uint64_t offset,
385 const struct iovec *iov,
386 int iovcnt,
387 uint16_t timeout = 0 );
388
389 //------------------------------------------------------------------------
400 //------------------------------------------------------------------------
402 ResponseHandler *handler,
403 uint16_t timeout = 0 )
405
406 //------------------------------------------------------------------------
415 //------------------------------------------------------------------------
417 Buffer *&response,
418 uint16_t timeout = 0 )
420
421 //------------------------------------------------------------------------
430 //------------------------------------------------------------------------
432 uint16_t timeout = 0 )
434
435 //------------------------------------------------------------------------
442 //------------------------------------------------------------------------
444 uint16_t timeout = 0 )
446
447 //------------------------------------------------------------------------
449 //------------------------------------------------------------------------
450 bool IsOpen() const;
451
452 //------------------------------------------------------------------------
459 //------------------------------------------------------------------------
460 bool SetProperty( const std::string &name, const std::string &value );
461
462 //------------------------------------------------------------------------
470 //------------------------------------------------------------------------
471 bool GetProperty( const std::string &name, std::string &value ) const;
472
473 private:
477 };
478}
479
480#endif // __XRD_CL_FILE_HH__
#define XRD_WARN_UNUSED_RESULT
Definition: XrdOucCompiler.hh:31
Binary blob representation.
Definition: XrdClBuffer.hh:34
Close operation (.
Definition: XrdClFileOperations.hh:309
Fcntl operation (.
Definition: XrdClFileOperations.hh:753
An interface for file plug-ins.
Definition: XrdClPlugInInterface.hh:37
Handle the stateful operations.
Definition: XrdClFileStateHandler.hh:48
A file.
Definition: XrdClFile.hh:45
virtual ~File()
Destructor.
VirtRedirect
Definition: XrdClFile.hh:49
@ EnableVirtRedirect
Definition: XrdClFile.hh:50
@ DisableVirtRedirect
Definition: XrdClFile.hh:51
bool IsOpen() const
Check if the file is open.
XRootDStatus Truncate(uint64_t size, ResponseHandler *handler, uint16_t timeout=0) XRD_WARN_UNUSED_RESULT
File(VirtRedirect virtRedirect, bool enablePlugIns=true)
Constructor.
XRootDStatus Open(const std::string &url, OpenFlags::Flags flags, Access::Mode mode, ResponseHandler *handler, uint16_t timeout=0) XRD_WARN_UNUSED_RESULT
bool GetProperty(const std::string &name, std::string &value) const
File(bool enablePlugIns=true)
Constructor.
XRootDStatus Stat(bool force, ResponseHandler *handler, uint16_t timeout=0) XRD_WARN_UNUSED_RESULT
FileStateHandler * pStateHandler
Definition: XrdClFile.hh:474
FilePlugIn * pPlugIn
Definition: XrdClFile.hh:475
bool SetProperty(const std::string &name, const std::string &value)
bool pEnablePlugIns
Definition: XrdClFile.hh:476
Open operation (.
Definition: XrdClFileOperations.hh:106
Read operation (.
Definition: XrdClFileOperations.hh:252
Handle an async response.
Definition: XrdClXRootDResponses.hh:855
Object stat info.
Definition: XrdClXRootDResponses.hh:333
Sync operation (.
Definition: XrdClFileOperations.hh:475
VectorRead operation (.
Definition: XrdClFileOperations.hh:584
Vector read info.
Definition: XrdClXRootDResponses.hh:790
VectorWrite operation (.
Definition: XrdClFileOperations.hh:641
Visa operation (.
Definition: XrdClFileOperations.hh:807
Write operation (.
Definition: XrdClFileOperations.hh:418
WriteV operation (.
Definition: XrdClFileOperations.hh:696
Request status.
Definition: XrdClXRootDResponses.hh:213
Definition: XrdClAnyObject.hh:26
std::vector< ChunkInfo > ChunkList
List of chunks.
Definition: XrdClXRootDResponses.hh:784
Access mode.
Definition: XrdClFileSystem.hh:118
Mode
Access mode.
Definition: XrdClFileSystem.hh:123
Open flags, may be or'd when appropriate.
Definition: XrdClFileSystem.hh:72
Flags
Open flags, may be or'd when appropriate.
Definition: XrdClFileSystem.hh:77