xoreos  0.0.5
Classes | Public Types | Public Member Functions | List of all members
Aurora::Archive Class Referenceabstract

An abstract file archive. More...

#include <archive.h>

Inheritance diagram for Aurora::Archive:
Inheritance graph
[legend]
Collaboration diagram for Aurora::Archive:
Collaboration graph
[legend]

Classes

struct  Resource
 A resource within the archive. More...
 

Public Types

typedef std::list< ResourceResourceList
 

Public Member Functions

 Archive ()
 
virtual ~Archive ()
 
virtual const ResourceListgetResources () const =0
 Return the list of resources. More...
 
virtual uint32 getResourceSize (uint32 index) const
 Return the size of a resource. More...
 
virtual Common::SeekableReadStreamgetResource (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...
 

Detailed Description

An abstract file archive.

Definition at line 45 of file archive.h.

Member Typedef Documentation

◆ ResourceList

Definition at line 57 of file archive.h.

Constructor & Destructor Documentation

◆ Archive()

Aurora::Archive::Archive ( )

Definition at line 34 of file archive.cpp.

◆ ~Archive()

Aurora::Archive::~Archive ( )
virtual

Definition at line 37 of file archive.cpp.

Member Function Documentation

◆ findResource() [1/2]

uint32 Aurora::Archive::findResource ( uint64  hash) const

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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ findResource() [2/2]

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().

Here is the call graph for this function:

◆ getNameHashAlgo()

Common::HashAlgo Aurora::Archive::getNameHashAlgo ( ) const
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().

Here is the caller graph for this function:

◆ getResource()

virtual Common::SeekableReadStream* Aurora::Archive::getResource ( uint32  index,
bool  tryNoCopy = false 
) const
pure virtual

Return a stream of the resource's contents.

Parameters
indexThe index of the resource we want.
tryNoCopyTry to return a SeekableSubReadStream of the archive instead of copying.
Returns
A (sub)stream of the resource's contents.

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().

Here is the caller graph for this function:

◆ getResources()

virtual const ResourceList& Aurora::Archive::getResources ( ) const
pure virtual

◆ getResourceSize()

uint32 Aurora::Archive::getResourceSize ( uint32  index) const
virtual

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().

Here is the caller graph for this function:

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