xoreos
0.0.5
|
An abstract file archive. More...
#include <archive.h>
Classes | |
struct | Resource |
A resource within the archive. More... | |
Public Types | |
typedef std::list< Resource > | ResourceList |
Public Member Functions | |
Archive () | |
virtual | ~Archive () |
virtual const ResourceList & | getResources () const =0 |
Return the list of resources. More... | |
virtual uint32 | getResourceSize (uint32 index) const |
Return the size of a resource. More... | |
virtual Common::SeekableReadStream * | getResource (uint32 index, bool tryNoCopy=false) const =0 |
Return a stream of the resource's contents. More... | |
virtual Common::HashAlgo | getNameHashAlgo () const |
Return with which algorithm the name is hashed. More... | |
uint32 | findResource (uint64 hash) const |
Return the index of the resource matching the hash, or 0xFFFFFFFF if not found. More... | |
uint32 | findResource (const Common::UString &name, FileType type) const |
Return the index of the resource matching the name and type, or 0xFFFFFFFF if not found. More... | |
typedef std::list<Resource> Aurora::Archive::ResourceList |
Aurora::Archive::Archive | ( | ) |
Definition at line 34 of file archive.cpp.
|
virtual |
Definition at line 37 of file archive.cpp.
Return the index of the resource matching the hash, or 0xFFFFFFFF if not found.
Definition at line 48 of file archive.cpp.
References getNameHashAlgo(), getResources(), and Common::kHashNone.
Referenced by Engines::Witcher::Module::getDescription(), Engines::DragonAge2::Area::getName(), Engines::DragonAge::Area::getName(), and Engines::Witcher::Module::getName().
uint32 Aurora::Archive::findResource | ( | const Common::UString & | name, |
FileType | type | ||
) | const |
Return the index of the resource matching the name and type, or 0xFFFFFFFF if not found.
Definition at line 59 of file archive.cpp.
References getResources().
|
virtual |
Return with which algorithm the name is hashed.
Reimplemented in Aurora::ERFFile, and Aurora::HERFFile.
Definition at line 44 of file archive.cpp.
References Common::kHashNone.
Referenced by findResource(), and Aurora::ResourceManager::indexArchive().
|
pure virtual |
Return a stream of the resource's contents.
index | The index of the resource we want. |
tryNoCopy | Try to return a SeekableSubReadStream of the archive instead of copying. |
Implemented in Aurora::ERFFile, Aurora::BIFFile, Aurora::RIMFile, Aurora::OBBFile, Aurora::BZFFile, Aurora::HERFFile, Aurora::NDSFile, Aurora::NSBTXFile, Aurora::TheWitcherSaveFile, Aurora::PEFile, and Aurora::ZIPFile.
Referenced by Aurora::ResourceManager::getArchiveResource().
|
pure virtual |
Return the list of resources.
Implemented in Aurora::ERFFile, Aurora::BIFFile, Aurora::RIMFile, Aurora::OBBFile, Aurora::BZFFile, Aurora::HERFFile, Aurora::NDSFile, Aurora::NSBTXFile, Aurora::PEFile, Aurora::TheWitcherSaveFile, and Aurora::ZIPFile.
Referenced by findResource(), and Aurora::ResourceManager::indexArchive().
Return the size of a resource.
Reimplemented in Aurora::ERFFile, Aurora::BIFFile, Aurora::RIMFile, Aurora::OBBFile, Aurora::BZFFile, Aurora::HERFFile, Aurora::NDSFile, Aurora::NSBTXFile, Aurora::TheWitcherSaveFile, and Aurora::ZIPFile.
Definition at line 40 of file archive.cpp.
Referenced by Aurora::ResourceManager::getResourceSize().