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 
63  FILE* inputFile;
64  bool xrootdFlag;
65 };
66 #endif
bool ok()
It is OK (i.e. file was correctly opened)
Definition: RawFile.cc:69
RawFile * open(const char *path)
Open file.
Definition: RawFile.cc:20
virtual ~RawFile()
Destructor.
Definition: RawFile.cc:65
bool fail()
It is not OK.
Definition: RawFile.cc:71
int read(void *data, size_t nbytes)
Read from file.
Definition: RawFile.cc:75
long tell()
Tell instruction.
Definition: RawFile.cc:97
FILE * GetPointer()
Get file pointer.
Definition: RawFile.cc:67
bool xrootdFlag
Definition: RawFile.h:64
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:83
int eof()
Check end of file.
Definition: RawFile.cc:93
int ignore(long offset)
Ignore some bytes.
Definition: RawFile.cc:91
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:82
FILE * inputFile
Definition: RawFile.h:63
RawFile()
Default constructor.
Definition: RawFile.cc:14
bool isXROOTD()
XROOTD flag.
Definition: RawFile.cc:73