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

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::SeekableReadStreamgetDataSource (uint32 index, bool is_text=false)
 
Common::SeekableReadStreamgetDataSource (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
 

Member Function Documentation

◆ exists() [1/2]

virtual bool Ultima::Ultima8::ArchiveFile::exists ( uint32  index)
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)

Parameters
indexindex of object to check for

Implemented in Ultima::Ultima8::FlexFile, and Ultima::Ultima8::NamedArchiveFile.

◆ exists() [2/2]

virtual bool Ultima::Ultima8::ArchiveFile::exists ( const Std::string name)
pure 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

Implemented in Ultima::Ultima8::FlexFile, Ultima::Ultima8::NamedArchiveFile, and Ultima::Ultima8::U8SaveFile.

◆ getObject() [1/2]

virtual uint8* Ultima::Ultima8::ArchiveFile::getObject ( uint32  index,
uint32 *  size = 0 
)
pure virtual

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

Implemented in Ultima::Ultima8::FlexFile, and Ultima::Ultima8::NamedArchiveFile.

◆ getObject() [2/2]

virtual uint8* Ultima::Ultima8::ArchiveFile::getObject ( const Std::string name,
uint32 *  size = 0 
)
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)

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

Implemented in Ultima::Ultima8::FlexFile, Ultima::Ultima8::NamedArchiveFile, and Ultima::Ultima8::U8SaveFile.

◆ getSize() [1/2]

virtual uint32 Ultima::Ultima8::ArchiveFile::getSize ( uint32  index) const
pure virtual

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

Parameters
indexindex of object to get size of

Implemented in Ultima::Ultima8::FlexFile, and Ultima::Ultima8::NamedArchiveFile.

◆ getSize() [2/2]

virtual uint32 Ultima::Ultima8::ArchiveFile::getSize ( const Std::string name) const
pure 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

Implemented in Ultima::Ultima8::FlexFile, Ultima::Ultima8::NamedArchiveFile, and Ultima::Ultima8::U8SaveFile.

◆ getDataSource() [1/2]

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

◆ getDataSource() [2/2]

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

◆ getCount()

virtual uint32 Ultima::Ultima8::ArchiveFile::getCount ( ) const
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.

◆ getIndexCount()

virtual uint32 Ultima::Ultima8::ArchiveFile::getIndexCount ( ) const
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.


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