xoreos
0.0.5
|
Class to hold resource data information of a BZF file. More...
#include <bzffile.h>
Classes | |
struct | IResource |
Internal resource information. More... | |
Public Member Functions | |
BZFFile (Common::SeekableReadStream *bzf) | |
Take over this stream and read a BZF file out of it. More... | |
~BZFFile () | |
const ResourceList & | getResources () const |
Return the list of resources. More... | |
uint32 | getResourceSize (uint32 index) const |
Return the size of a resource. More... | |
Common::SeekableReadStream * | getResource (uint32 index, bool tryNoCopy=false) const |
Return a stream of the resource's contents. More... | |
void | mergeKEY (const KEYFile &key, uint32 dataFileIndex) |
Merge information from the KEY into the data file. More... | |
Public Member Functions inherited from Aurora::KEYDataFile | |
virtual | ~KEYDataFile () |
Public Member Functions inherited from Aurora::Archive | |
Archive () | |
virtual | ~Archive () |
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... | |
Public Member Functions inherited from Aurora::AuroraFile | |
AuroraFile () | |
void | clear () |
uint32 | getID () const |
Return the file's ID. More... | |
uint32 | getVersion () const |
Return the file's version. More... | |
bool | isUTF16LE () const |
Were the ID and version encoded in little-endian UTF-16 in the file? More... | |
Private Types | |
typedef std::vector< IResource > | IResourceList |
Private Member Functions | |
void | load (Common::SeekableReadStream &bzf) |
void | readVarResTable (Common::SeekableReadStream &bzf, uint32 offset) |
const IResource & | getIResource (uint32 index) const |
Private Attributes | |
Common::ScopedPtr< Common::SeekableReadStream > | _bzf |
ResourceList | _resources |
External list of resource names and types. More... | |
IResourceList | _iResources |
Internal list of resource offsets and sizes. More... | |
Additional Inherited Members | |
Public Types inherited from Aurora::Archive | |
typedef std::list< Resource > | ResourceList |
Static Public Member Functions inherited from Aurora::AuroraFile | |
static void | readHeader (Common::ReadStream &stream, uint32 &id, uint32 &version, bool &utf16le) |
Read the header out of a stream. More... | |
static void | readHeader (Common::ReadStream &stream, uint32 &id, uint32 &version) |
Read the ID and version out of a stream. More... | |
static uint32 | readHeaderID (Common::ReadStream &stream) |
Read the ID out of a stream. More... | |
Protected Member Functions inherited from Aurora::AuroraFile | |
void | readHeader (Common::ReadStream &stream) |
Static Protected Member Functions inherited from Aurora::AuroraFile | |
static uint32 | convertUTF16LE (uint32 x1, uint32 x2) |
Protected Attributes inherited from Aurora::AuroraFile | |
uint32 | _id |
The file's ID. More... | |
uint32 | _version |
The file's version. More... | |
bool | _utf16le |
The file's ID and version are in little-endian UTF-16. More... | |
Class to hold resource data information of a BZF file.
A BZF is a compressed variation of a BIF file, found exclusively in the Android and iOS version of Knights of the Old Republic.
See also classes KEYFile in keyfile.h and BIFFile in biffile.h.
|
private |
Aurora::BZFFile::BZFFile | ( | Common::SeekableReadStream * | bzf | ) |
Take over this stream and read a BZF file out of it.
Definition at line 44 of file bzffile.cpp.
Aurora::BZFFile::~BZFFile | ( | ) |
Definition at line 50 of file bzffile.cpp.
|
private |
Definition at line 132 of file bzffile.cpp.
References _iResources.
Referenced by getResource(), and getResourceSize().
|
virtual |
Return a stream of the resource's contents.
Implements Aurora::Archive.
Definition at line 143 of file bzffile.cpp.
References _bzf, Common::decompressLZMA1(), getIResource(), Aurora::BZFFile::IResource::offset, Aurora::BZFFile::IResource::packedSize, and Aurora::BZFFile::IResource::size.
|
virtual |
Return the list of resources.
Implements Aurora::Archive.
Definition at line 128 of file bzffile.cpp.
References _resources.
Return the size of a resource.
Reimplemented from Aurora::Archive.
Definition at line 139 of file bzffile.cpp.
References getIResource(), and Aurora::BZFFile::IResource::size.
|
private |
Definition at line 53 of file bzffile.cpp.
References Aurora::AuroraFile::_id, _iResources, Aurora::AuroraFile::_version, Common::StackException::add(), Common::debugTag(), kBZFID, kVersion1, Aurora::AuroraFile::readHeader(), Common::ReadStream::readUint32LE(), and readVarResTable().
Referenced by BZFFile().
Merge information from the KEY into the data file.
Without this step, this data file archive does not contain any resource names at all.
key | A KEYFile with information about this data file. |
dataFileIndex | The index this data file has within the KEY file. |
Implements Aurora::KEYDataFile.
Definition at line 101 of file bzffile.cpp.
References _iResources, _resources, Aurora::KEYFile::getResources(), Aurora::Archive::Resource::name, and warning().
|
private |
Definition at line 83 of file bzffile.cpp.
References _iResources, Common::ReadStream::readUint32LE(), Common::SeekableReadStream::seek(), Common::SeekableReadStream::size(), and Common::SeekableReadStream::skip().
Referenced by load().
|
private |
Definition at line 93 of file bzffile.h.
Referenced by BZFFile(), and getResource().
|
private |
Internal list of resource offsets and sizes.
Definition at line 99 of file bzffile.h.
Referenced by getIResource(), load(), mergeKEY(), and readVarResTable().
|
private |
External list of resource names and types.
Definition at line 96 of file bzffile.h.
Referenced by getResources(), and mergeKEY().