CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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 rfioFlag;
65  bool xrootdFlag;
66 };
67 #endif
bool ok()
It is OK (i.e. file was correctly opened)
Definition: RawFile.cc:86
RawFile * open(const char *path)
Open file.
Definition: RawFile.cc:29
virtual ~RawFile()
Destructor.
Definition: RawFile.cc:82
bool fail()
It is not OK.
Definition: RawFile.cc:88
int read(void *data, size_t nbytes)
Read from file.
Definition: RawFile.cc:94
long tell()
Tell instruction.
Definition: RawFile.cc:126
FILE * GetPointer()
Get file pointer.
Definition: RawFile.cc:84
bool rfioFlag
Definition: RawFile.h:64
bool xrootdFlag
Definition: RawFile.h:65
bool isRFIO()
Castor flag.
Definition: RawFile.cc:90
int close()
Close file if necessary.
Definition: RawFile.cc:66
int seek(long offset, int whence)
Go somewhere.
Definition: RawFile.cc:105
int eof()
Check end of file.
Definition: RawFile.cc:118
int ignore(long offset)
Ignore some bytes.
Definition: RawFile.cc:116
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:82
FILE * inputFile
Definition: RawFile.h:63
RawFile()
Default constructor.
Definition: RawFile.cc:23
bool isXROOTD()
XROOTD flag.
Definition: RawFile.cc:92