#include <MappedFile.h>
Public Member Functions | |
MappedFile (const UString &filename) | |
bool | operator== (const MappedFile &f) const |
size_t | FileSize () |
Public Member Functions inherited from pdftron::Filters::Filter | |
Filter () | |
~Filter () | |
Filter (const Filter ©) | |
Filter & | operator= (const Filter &other) |
operator bool () | |
void | AttachFilter (Filter attach_filter) |
Filter | ReleaseAttachedFilter () |
Filter | GetAttachedFilter () |
Filter | GetSourceFilter () |
const char * | GetName () const |
const char * | GetDecodeName () const |
UChar * | Begin () |
size_t | Size () |
void | Consume (size_t num_bytes) |
size_t | Count () |
size_t | SetCount (size_t new_count) |
void | SetStreamLength (size_t bytes) |
void | Flush () |
void | FlushAll () |
bool | IsInputFilter () |
bool | CanSeek () |
void | Seek (ptrdiff_t offset, ReferencePos origin) |
ptrdiff_t | Tell () |
size_t | Truncate (size_t new_size) |
Filter | CreateInputIterator () |
const UString | GetFilePath () const |
void | Destroy () |
void | WriteToFile (const UString &path, bool append) |
Static Public Member Functions | |
static bool | Equivalent (const UString &ph1, const UString &ph2) |
Additional Inherited Members | |
Public Types inherited from pdftron::Filters::Filter | |
enum | ReferencePos { e_begin = SEEK_SET, e_end = SEEK_END, e_cur = SEEK_CUR } |
MappedFile is a utility class to read files on a file system. Because MappedFile file is derived from pdftron.Filters.Filter you can directly chain MappedFile objects to other 'pdftron.Filters'.
MappedFile objects support random access to files using the Seek method. Seek allows the read/write position to be moved to any position within the file. This is done through a shared memory mapped chunk manager. The byte offset is relative to the seek reference point, which can be the beginning, the current position, or the end of the underlying file, as represented by the three properties of the Filter.ReferencePos class.
MappedFile objects are thread-safe, meaning separate copies of a MappedFile can Seek to different locations in the file, without conflicting with one another.
Disk files always support random access. At the time of construction, the CanSeek() property value is set to true or false depending on the underlying file type.
Definition at line 37 of file MappedFile.h.
pdftron::Filters::MappedFile::MappedFile | ( | const UString & | filename | ) |
Create a new instance of MappedFile class with the specified path
|
static |
Check is the two file paths are equivalent (i.e. they refer to the same file on disc.
size_t pdftron::Filters::MappedFile::FileSize | ( | ) |
bool pdftron::Filters::MappedFile::operator== | ( | const MappedFile & | f | ) | const |
Check is the two MappedFile-s refer to the same file on disc.