xoreos  0.0.5
Classes | Public Types | Public Member Functions | Private Member Functions | Private Attributes | List of all members
Aurora::KEYFile Class Reference

Class to hold resource index information of a KEY file. More...

#include <keyfile.h>

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

Classes

struct  Resource
 A key resource index. More...
 

Public Types

typedef std::vector< ResourceResourceList
 
typedef std::vector< Common::UStringBIFList
 

Public Member Functions

 KEYFile (Common::SeekableReadStream &key)
 
 ~KEYFile ()
 
const BIFListgetBIFs () const
 Return a list of all managed bifs. More...
 
const ResourceListgetResources () const
 Return a list of all containing resources. 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 Member Functions

void load (Common::SeekableReadStream &key)
 
void readBIFList (Common::SeekableReadStream &key, uint32 offset)
 
void readResList (Common::SeekableReadStream &key, uint32 offset)
 

Private Attributes

BIFList _bifs
 All managed bifs. More...
 
ResourceList _resources
 All containing resources. More...
 

Additional Inherited Members

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

Detailed Description

Class to hold resource index information of a KEY file.

A KEY file is one part of the KEY/BIF resource archive system. The KEY file contains the resource names and types, and the BIF file contains the actual resource data. So KEY files only contain the resource meta-data.

A KEY file can index resources of several BIF files and several BIF files can in turn index different resources of the same BIF file.

Additionally, there are BZF files. A BZF is a compressed variation of a BIF file, found exclusively in the iOS version of Knights of the Old Republic.

See also classes BIFFile in biffile.h and BZFFile in bzffile.h.

There are two versions of KEY files known and supported

Please note that KEY (and BIF) files found in Infinity Engine games (Baldur's Gate et al) are not supported at all, even though they claim to be V1.

Definition at line 70 of file keyfile.h.

Member Typedef Documentation

◆ BIFList

Definition at line 82 of file keyfile.h.

◆ ResourceList

Definition at line 81 of file keyfile.h.

Constructor & Destructor Documentation

◆ KEYFile()

Aurora::KEYFile::KEYFile ( Common::SeekableReadStream key)

Definition at line 43 of file keyfile.cpp.

References load().

Here is the call graph for this function:

◆ ~KEYFile()

Aurora::KEYFile::~KEYFile ( )

Definition at line 47 of file keyfile.cpp.

Member Function Documentation

◆ getBIFs()

const KEYFile::BIFList & Aurora::KEYFile::getBIFs ( ) const

Return a list of all managed bifs.

Definition at line 141 of file keyfile.cpp.

References _bifs.

Referenced by Aurora::ResourceManager::openKEYBIFs().

Here is the caller graph for this function:

◆ getResources()

const KEYFile::ResourceList & Aurora::KEYFile::getResources ( ) const

Return a list of all containing resources.

Definition at line 145 of file keyfile.cpp.

References _resources.

Referenced by Aurora::BZFFile::mergeKEY(), and Aurora::BIFFile::mergeKEY().

Here is the caller graph for this function:

◆ load()

void Aurora::KEYFile::load ( Common::SeekableReadStream key)
private

◆ readBIFList()

void Aurora::KEYFile::readBIFList ( Common::SeekableReadStream key,
uint32  offset 
)
private

Definition at line 90 of file keyfile.cpp.

References _bifs, Aurora::AuroraFile::_version, Common::kEncodingASCII, kVersion11, Common::readStringFixed(), Common::ReadStream::readUint16LE(), Common::ReadStream::readUint32LE(), Common::SeekableReadStream::seek(), and Common::SeekableReadStream::skip().

Referenced by load().

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

◆ readResList()

void Aurora::KEYFile::readResList ( Common::SeekableReadStream key,
uint32  offset 
)
private

Definition at line 119 of file keyfile.cpp.

References _resources, Aurora::AuroraFile::_version, Common::kEncodingASCII, kVersion11, Common::readStringFixed(), Common::ReadStream::readUint16LE(), Common::ReadStream::readUint32LE(), and Common::SeekableReadStream::seek().

Referenced by load().

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

Member Data Documentation

◆ _bifs

BIFList Aurora::KEYFile::_bifs
private

All managed bifs.

Definition at line 94 of file keyfile.h.

Referenced by getBIFs(), load(), and readBIFList().

◆ _resources

ResourceList Aurora::KEYFile::_resources
private

All containing resources.

Definition at line 95 of file keyfile.h.

Referenced by getResources(), load(), and readResList().


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