Public Member Functions | |
virtual bool | isValid () const |
Check if constructed object is indeed a valid archive. | |
virtual bool | exists (uint32 index)=0 |
virtual bool | exists (const Std::string &name)=0 |
virtual uint8 * | getObject (uint32 index, uint32 *size=0)=0 |
virtual uint8 * | getObject (const Std::string &name, uint32 *size=0)=0 |
virtual uint32 | getSize (uint32 index) const =0 |
virtual uint32 | getSize (const Std::string &name) const =0 |
Common::SeekableReadStream * | getDataSource (uint32 index, bool is_text=false) |
Common::SeekableReadStream * | getDataSource (const Std::string &name, bool is_text=false) |
virtual uint32 | getCount () const =0 |
virtual uint32 | getIndexCount () const =0 |
virtual bool | isIndexed () const =0 |
is archive indexed? | |
virtual bool | isNamed () const =0 |
is archive named? | |
Static Protected Member Functions | |
static bool | extractIndexFromName (const Std::string &name, uint32 &index) |
Protected Attributes | |
bool | _valid |
|
pure virtual |
Check if numbered object exists If the Flex has named objects, only objects with numerical names will be returned (the filename without the extension must be an integer)
index | index of object to check for |
Implemented in Ultima::Ultima8::FlexFile, and Ultima::Ultima8::NamedArchiveFile.
|
pure virtual |
Check if named object exists If the Flex is not named, name must be an integer with an optional extension
name | name of object to check for |
Implemented in Ultima::Ultima8::FlexFile, Ultima::Ultima8::NamedArchiveFile, and Ultima::Ultima8::U8SaveFile.
|
pure virtual |
Get object from file; returns NULL if index is invalid. Must delete the returned buffer afterwards. See also exists(uint32 index)
index | index of object to fetch |
size | if non-NULL, size of object is stored in *size |
Implemented in Ultima::Ultima8::FlexFile, and Ultima::Ultima8::NamedArchiveFile.
|
pure virtual |
Get named object from file; returns NULL if name is invalid. Must delete the returned buffer afterwards. See also exists(Std::string name)
name | name of object to fetch |
size | if non-NULL, size of object is stored in *size |
Implemented in Ultima::Ultima8::FlexFile, Ultima::Ultima8::NamedArchiveFile, and Ultima::Ultima8::U8SaveFile.
|
pure virtual |
Get size of object; returns zero if index is invalid. See also exists(uint32 index)
index | index of object to get size of |
Implemented in Ultima::Ultima8::FlexFile, and Ultima::Ultima8::NamedArchiveFile.
|
pure virtual |
Get size of named object; returns zero if name is invalid See also exists(Std::string name)
index | index of object to get size of |
Implemented in Ultima::Ultima8::FlexFile, Ultima::Ultima8::NamedArchiveFile, and Ultima::Ultima8::U8SaveFile.
Common::SeekableReadStream* Ultima::Ultima8::ArchiveFile::getDataSource | ( | uint32 | index, |
bool | is_text = false |
||
) |
Get object as a Common::SeekableReadStream Delete the SeekableReadStream afterwards; that will delete the data as well
Common::SeekableReadStream* Ultima::Ultima8::ArchiveFile::getDataSource | ( | const Std::string & | name, |
bool | is_text = false |
||
) |
Get named as a Common::SeekableReadStream Delete the SeekableReadStream afterwards; that will delete the data as well
|
pure virtual |
Get upper bound for number of objects. In an indexed file this is (probably) the highest index plus one, while in a named file it's (probably) the actual count
Implemented in Ultima::Ultima8::FlexFile, Ultima::Ultima8::NamedArchiveFile, and Ultima::Ultima8::U8SaveFile.
|
pure virtual |
Get the highest index in the file Guaranteed to be sufficiently large for a vector that needs to store the indexed entries of this file
Implemented in Ultima::Ultima8::FlexFile, and Ultima::Ultima8::NamedArchiveFile.