1 #ifndef __lib_base_rawfile_h
2 #define __lib_base_rawfile_h
5 #include <lib/base/idatasource.h>
7 class eRawFile: public iDataSource
14 int open(const char *filename, int cached = 0);
19 off_t lseek(off_t offset, int whence);
20 ssize_t read(off_t offset, void *buf, size_t count);
24 int m_fd; /* for uncached */
25 FILE *m_file; /* for cached */
27 std::string m_basename;
28 off_t m_splitsize, m_totallength, m_current_offset, m_base_offset, m_last_offset;
32 int switchOffset(off_t off);
34 off_t lseek_internal(off_t offset, int whence);
35 FILE *openFileCached(int nr);
36 int openFileUncached(int nr);