CMS 3D CMS Logo

RawFile.h
Go to the documentation of this file.
1 #ifndef DaqSource_RawFile_h
2 #define DaqSource_RawFile_h
3 
11 #include <iostream>
12 //#include <boost/cstdint.hpp>
13 
14 class RawFile {
15 public:
17  RawFile();
18 
20  RawFile(const char* path);
21 
23  RawFile* open(const char* path);
24 
26  int close();
27 
29  virtual ~RawFile();
30 
32  FILE* GetPointer();
33 
35  bool ok();
36 
38  bool fail();
39 
41  bool isRFIO();
42 
44  bool isXROOTD();
45 
47  int read(void* data, size_t nbytes);
48 
50  int seek(long offset, int whence);
51 
53  int ignore(long offset);
54 
56  int eof();
57 
59  long tell();
60 
61 private:
62  FILE* inputFile;
63  bool xrootdFlag;
64 };
65 #endif
bool ok()
It is OK (i.e. file was correctly opened)
Definition: RawFile.cc:70
RawFile * open(const char *path)
Open file.
Definition: RawFile.cc:19
virtual ~RawFile()
Destructor.
Definition: RawFile.cc:66
bool fail()
It is not OK.
Definition: RawFile.cc:72
int read(void *data, size_t nbytes)
Read from file.
Definition: RawFile.cc:76
long tell()
Tell instruction.
Definition: RawFile.cc:98
FILE * GetPointer()
Get file pointer.
Definition: RawFile.cc:68
bool xrootdFlag
Definition: RawFile.h:63
bool isRFIO()
Castor flag.
int close()
Close file if necessary.
Definition: RawFile.cc:52
int seek(long offset, int whence)
Go somewhere.
Definition: RawFile.cc:84
int eof()
Check end of file.
Definition: RawFile.cc:94
int ignore(long offset)
Ignore some bytes.
Definition: RawFile.cc:92
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:79
FILE * inputFile
Definition: RawFile.h:62
RawFile()
Default constructor.
Definition: RawFile.cc:15
bool isXROOTD()
XROOTD flag.
Definition: RawFile.cc:74