ScummVM API documentation
Ultima::Ultima8::NamedArchiveFile Class Referenceabstract
Inheritance diagram for Ultima::Ultima8::NamedArchiveFile:
Ultima::Ultima8::ArchiveFile Ultima::Ultima8::U8SaveFile

Public Member Functions

bool exists (uint32 index) override
 
bool exists (const Std::string &name) override=0
 
uint8 * getObject (uint32 index, uint32 *size=0) override
 
uint8 * getObject (const Std::string &name, uint32 *size=0) override=0
 
uint32 getSize (uint32 index) const override
 
uint32 getSize (const Std::string &name) const override=0
 
uint32 getCount () const override=0
 
uint32 getIndexCount () const override
 
bool isIndexed () const override
 is archive indexed?
 
bool isNamed () const override
 is archive named?
 
- Public Member Functions inherited from Ultima::Ultima8::ArchiveFile
virtual bool isValid () const
 Check if constructed object is indeed a valid archive.
 
Common::SeekableReadStreamgetDataSource (uint32 index, bool is_text=false)
 
Common::SeekableReadStreamgetDataSource (const Std::string &name, bool is_text=false)
 

Protected Member Functions

bool indexToName (uint32 index, Std::string &name) const
 
void storeIndexedName (const Std::string &name)
 

Protected Attributes

Common::HashMap< uint32, Std::string_indexedNames
 
uint32 _indexCount
 
- Protected Attributes inherited from Ultima::Ultima8::ArchiveFile
bool _valid
 

Additional Inherited Members

- Static Protected Member Functions inherited from Ultima::Ultima8::ArchiveFile
static bool extractIndexFromName (const Std::string &name, uint32 &index)
 

Member Function Documentation

◆ exists() [1/2]

bool Ultima::Ultima8::NamedArchiveFile::exists ( uint32  index)
inlineoverridevirtual

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)

Parameters
indexindex of object to check for

Implements Ultima::Ultima8::ArchiveFile.

◆ exists() [2/2]

bool Ultima::Ultima8::NamedArchiveFile::exists ( const Std::string name)
overridepure virtual

Check if named object exists If the Flex is not named, name must be an integer with an optional extension

Parameters
namename of object to check for

Implements Ultima::Ultima8::ArchiveFile.

Implemented in Ultima::Ultima8::U8SaveFile.

◆ getObject() [1/2]

uint8* Ultima::Ultima8::NamedArchiveFile::getObject ( uint32  index,
uint32 *  size = 0 
)
inlineoverridevirtual

Get object from file; returns NULL if index is invalid. Must delete the returned buffer afterwards. See also exists(uint32 index)

Parameters
indexindex of object to fetch
sizeif non-NULL, size of object is stored in *size

Implements Ultima::Ultima8::ArchiveFile.

◆ getObject() [2/2]

uint8* Ultima::Ultima8::NamedArchiveFile::getObject ( const Std::string name,
uint32 *  size = 0 
)
overridepure virtual

Get named object from file; returns NULL if name is invalid. Must delete the returned buffer afterwards. See also exists(Std::string name)

Parameters
namename of object to fetch
sizeif non-NULL, size of object is stored in *size

Implements Ultima::Ultima8::ArchiveFile.

Implemented in Ultima::Ultima8::U8SaveFile.

◆ getSize() [1/2]

uint32 Ultima::Ultima8::NamedArchiveFile::getSize ( uint32  index) const
inlineoverridevirtual

Get size of object; returns zero if index is invalid. See also exists(uint32 index)

Parameters
indexindex of object to get size of

Implements Ultima::Ultima8::ArchiveFile.

◆ getSize() [2/2]

uint32 Ultima::Ultima8::NamedArchiveFile::getSize ( const Std::string name) const
overridepure virtual

Get size of named object; returns zero if name is invalid See also exists(Std::string name)

Parameters
indexindex of object to get size of

Implements Ultima::Ultima8::ArchiveFile.

Implemented in Ultima::Ultima8::U8SaveFile.

◆ getCount()

uint32 Ultima::Ultima8::NamedArchiveFile::getCount ( ) const
overridepure 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

Implements Ultima::Ultima8::ArchiveFile.

Implemented in Ultima::Ultima8::U8SaveFile.

◆ getIndexCount()

uint32 Ultima::Ultima8::NamedArchiveFile::getIndexCount ( ) const
inlineoverridevirtual

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

Implements Ultima::Ultima8::ArchiveFile.


The documentation for this class was generated from the following file: