1#ifndef __XRDPOSIXPREPIO_HH__
2#define __XRDPOSIXPREPIO_HH__
46long long FSize() {
return (Init() ? fileP->FSize() : openRC);}
49 {
return (Init() ? fileP->Fstat(buf) : openRC);}
51int Open() {Init();
return openRC;}
53const char *
Path() {
return fileP->Path();}
55int Read (
char *Buffer,
long long Offset,
int Length)
56 {
return (Init() ? fileP->Read(Buffer, Offset, Length) : openRC);}
59 {
if (Init(&iocb)) fileP->Read(iocb, buff, offs, rlen);
60 else iocb.
Done(openRC);
64 {
return (Init() ? fileP->ReadV(readV, n) : openRC);}
67 {
if (Init(&iocb)) fileP->ReadV(iocb, readV, rnum);
68 else iocb.
Done(openRC);
71int Sync() {
return (Init() ? fileP->Sync() : openRC);}
74 {
if (Init(&iocb)) fileP->Sync(iocb);
75 else iocb.
Done(openRC);
79 {
return (Init() ? fileP->Trunc(Offset) : openRC);}
81int Write(
char *Buffer,
long long Offset,
int Length)
82 {
return (Init() ? fileP->Write(Buffer,Offset,Length) : openRC);}
85 {
if (Init(&iocb)) fileP->Write(iocb, buff, offs, wlen);
86 else iocb.
Done(openRC);
91 : fileP(fP), openRC(0), iCalls(0),
92 clFlags(clflags), clMode(clmode) {}
virtual void Done(int result)=0
XrdOucCacheIO()
Construct and Destructor.
int ReadV(const XrdOucIOVec *readV, int n)
int Read(char *Buffer, long long Offset, int Length)
int Write(char *Buffer, long long Offset, int Length)
bool Detach(XrdOucCacheIOCD &cdP)
void Sync(XrdOucCacheIOCB &iocb)
void Write(XrdOucCacheIOCB &iocb, char *buff, long long offs, int wlen)
void Read(XrdOucCacheIOCB &iocb, char *buff, long long offs, int rlen)
int Trunc(long long Offset)
XrdPosixPrepIO(XrdPosixFile *fP, XrdCl::OpenFlags::Flags clflags, XrdCl::Access::Mode clmode)
virtual ~XrdPosixPrepIO()
void ReadV(XrdOucCacheIOCB &iocb, const XrdOucIOVec *readV, int rnum)
int Fstat(struct stat &buf)
Flags
Open flags, may be or'd when appropriate.