The virtual seeker class is a simple definition of an object that keeps track of a set of specified (virtual) file pointers that mark start and end of a file inside another.
An example of its use (and its reason for existence) is to keep track of the file endings of a Zip file embedded in another file (see the appendzip tool and the ZipFile::openEmbeddedZipFile() function).
- The class is not linked to an input stream when created or the offsets get modified. This means the seek and tell functions cannot be sure that the offsets are valid of the specified input buffer.
Definition at line 46 of file virtualseeker.hpp.
This function calculates the position (file current pointer) within the embedded file in the specified stream.
If the position in the existing file is too large or too small, then the function returns -1.
|[in]||is||The stream to get the position from.|
- The stream offset within the embedded file.
- We may want to get the size of the file and verify that the resulting position is valid. The m_end_offset does not really mean anything at this point that we could use to verify the position boundaries (since it is a positive size from the end of the file.)
Definition at line 218 of file virtualseeker.cpp.
Referenced by zipios::BackBuffer::BackBuffer(), and zipios::ZipFile::ZipFile().