xoreos  0.0.5
Public Member Functions | Static Public Member Functions | Protected Member Functions | Static Protected Member Functions | Protected Attributes | List of all members
Aurora::AuroraFile Class Reference

Base class for most files found in games using BioWare's Aurora engine. More...

#include <aurorafile.h>

Inheritance diagram for Aurora::AuroraFile:
Inheritance graph
[legend]

Public Member Functions

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

Static Public Member Functions

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

void readHeader (Common::ReadStream &stream)
 

Static Protected Member Functions

static uint32 convertUTF16LE (uint32 x1, uint32 x2)
 

Protected Attributes

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

Base class for most files found in games using BioWare's Aurora engine.

Aurora files generally start with a 4-byte human-readable ID, for example 'ERF ', followed by a 4-byte version string, like 'V1.0'. This base class reads them as big-endian 32-bit integer values. See the MKTAG() macro, as defined in src/common/endianness.h, for generating values to compare the IDs read out of a stream against.

Later games encode these ID and version values as 8-byte, little-endian UTF-16 strings instead. We automatically detect this, convert them back into the old format, and set a flag that can be queried with the method isUTF16LE().

Alternatively, AuroraFile provides static methods for reading the base header out of a stream.

Definition at line 52 of file aurorafile.h.

Constructor & Destructor Documentation

◆ AuroraFile()

Aurora::AuroraFile::AuroraFile ( )

Definition at line 31 of file aurorafile.cpp.

References clear().

Here is the call graph for this function:

Member Function Documentation

◆ clear()

void Aurora::AuroraFile::clear ( )

Definition at line 35 of file aurorafile.cpp.

References _id, _utf16le, and _version.

Referenced by AuroraFile().

Here is the caller graph for this function:

◆ convertUTF16LE()

uint32 Aurora::AuroraFile::convertUTF16LE ( uint32  x1,
uint32  x2 
)
staticprotected

Definition at line 88 of file aurorafile.cpp.

Referenced by readHeader().

Here is the caller graph for this function:

◆ getID()

uint32 Aurora::AuroraFile::getID ( ) const

Return the file's ID.

Definition at line 41 of file aurorafile.cpp.

References _id.

◆ getVersion()

uint32 Aurora::AuroraFile::getVersion ( ) const

Return the file's version.

Definition at line 45 of file aurorafile.cpp.

References _version.

◆ isUTF16LE()

bool Aurora::AuroraFile::isUTF16LE ( ) const

Were the ID and version encoded in little-endian UTF-16 in the file?

Definition at line 49 of file aurorafile.cpp.

References _utf16le.

◆ readHeader() [1/3]

void Aurora::AuroraFile::readHeader ( Common::ReadStream stream,
uint32 id,
uint32 version,
bool &  utf16le 
)
static

◆ readHeader() [2/3]

void Aurora::AuroraFile::readHeader ( Common::ReadStream stream,
uint32 id,
uint32 version 
)
static

Read the ID and version out of a stream.

Definition at line 72 of file aurorafile.cpp.

References readHeader().

Here is the call graph for this function:

◆ readHeader() [3/3]

void Aurora::AuroraFile::readHeader ( Common::ReadStream stream)
protected

Definition at line 84 of file aurorafile.cpp.

References _id, _utf16le, _version, and readHeader().

Here is the call graph for this function:

◆ readHeaderID()

uint32 Aurora::AuroraFile::readHeaderID ( Common::ReadStream stream)
static

Read the ID out of a stream.

Definition at line 77 of file aurorafile.cpp.

References readHeader().

Referenced by Graphics::Aurora::ModelNode_DragonAge::readMAO().

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

Member Data Documentation

◆ _id

uint32 Aurora::AuroraFile::_id
protected

◆ _utf16le

bool Aurora::AuroraFile::_utf16le
protected

The file's ID and version are in little-endian UTF-16.

Definition at line 79 of file aurorafile.h.

Referenced by clear(), isUTF16LE(), Aurora::ERFFile::load(), and readHeader().

◆ _version

uint32 Aurora::AuroraFile::_version
protected

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