10 const size_t rpos =
pointer + bytes;
116 if (it.magic == chunkName)
119 pointer = (resetToStart ? 0 : it.pointer);
158 LOG_INFO <<
"Chunk :" << it.magic.c_str() << it.start << it.size;
virtual void doPostOpenOperation()=0
unsigned char * getPointer()
Pointer to the current read position within the buffer.
virtual bool doPostCloseOperation()=0
bool open(bool useMemoryBuffer=true)
Open the file, optionally loading into a memory buffer.
virtual void seek(size_t offset)
Seek to an absolute byte offset.
size_t getPos()
Current read position.
size_t getSize()
Total size of the file in bytes.
std::vector< Chunk > chunks
virtual void dumpStructure()
virtual unsigned long readFile()=0
virtual bool isAlreadyOpened()=0
virtual bool openFile()=0
unsigned char * getBuffer() const
Pointer to the start of the internal buffer.
bool close()
Close the file and release the internal buffer.
virtual size_t read(void *dest, size_t bytes)
Read bytes from the file into dest.
unsigned long long pointer
void seekRelative(size_t offset)
Advance the read pointer by offset bytes.
unsigned char * originalBuffer
bool setChunk(std::string chunkName, bool resetToStart=true)
Switch the active read window to the named chunk.
virtual bool getFileSize(unsigned long long &s)=0
void allocate(unsigned long long size)
Allocate (or reallocate) the internal buffer to the given size.
bool isEof()
True if the read pointer has reached the end of the file.