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

#include <gff4file.h>

Collaboration diagram for Aurora::GFF4Struct:
Collaboration graph
[legend]

Classes

struct  Field
 A field in the GFF4 struct. More...
 

Public Types

enum  FieldType {
  kFieldTypeNone = - 1, kFieldTypeUint8 = 0, kFieldTypeSint8 = 1, kFieldTypeUint16 = 2,
  kFieldTypeSint16 = 3, kFieldTypeUint32 = 4, kFieldTypeSint32 = 5, kFieldTypeUint64 = 6,
  kFieldTypeSint64 = 7, kFieldTypeFloat32 = 8, kFieldTypeFloat64 = 9, kFieldTypeVector3f = 10,
  kFieldTypeVector4f = 12, kFieldTypeQuaternionf = 13, kFieldTypeString = 14, kFieldTypeColor4f = 15,
  kFieldTypeMatrix4x4f = 16, kFieldTypeTlkString = 17, kFieldTypeNDSFixed = 18, kFieldTypeASCIIString = 20,
  kFieldTypeStruct = 65534, kFieldTypeGeneric = 65535
}
 The type of a GFF4 field. More...
 

Public Member Functions

uint64 getID () const
 Return the struct's unique ID within the GFF4. More...
 
uint32 getRefCount () const
 Return the number of structs that refer to this struct. More...
 
uint32 getLabel () const
 Return the struct's label. More...
 
size_t getFieldCount () const
 Return the number of fields in this struct. More...
 
bool hasField (uint32 field) const
 Does this specific field exist? More...
 
const std::vector< uint32 > & getFieldLabels () const
 Return a list of all field labels in this struct. More...
 
FieldType getFieldType (uint32 field) const
 Return the type of this field, or kFieldTypeNone if it doesn't exist. More...
 
FieldType getFieldType (uint32 field, bool &isList) const
 Return the type of this field and whether it's list, or kFieldTypeNone if it doesn't exist. More...
 
bool getFieldProperties (uint32 field, FieldType &type, uint32 &label, bool &isList) const
 Collectively return all field properties in one go. More...
 
uint64 getUint (uint32 field, uint64 def=0) const
 
int64 getSint (uint32 field, int64 def=0) const
 
bool getBool (uint32 field, bool def=false) const
 
double getDouble (uint32 field, double def=0.0) const
 
float getFloat (uint32 field, float def=0.0f) const
 
Common::UString getString (uint32 field, Common::Encoding encoding, const Common::UString &def="") const
 Return a field string, read from the given encoding. More...
 
Common::UString getString (uint32 field, const Common::UString &def="") const
 Return a field string, read from the default UTF-16LE encoding. More...
 
bool getTalkString (uint32 field, Common::Encoding encoding, uint32 &strRef, Common::UString &str) const
 Return a talk string, which is a reference into the TalkTable and an optional direct string. More...
 
bool getTalkString (uint32 field, uint32 &strRef, Common::UString &str) const
 Return a talk string, which is a reference into the TalkTable and an optional direct string. More...
 
bool getVector3 (uint32 field, double &v1, double &v2, double &v3) const
 
bool getVector4 (uint32 field, double &v1, double &v2, double &v3, double &v4) const
 
bool getMatrix4x4 (uint32 field, double(&m)[16]) const
 
bool getVector3 (uint32 field, float &v1, float &v2, float &v3) const
 
bool getVector4 (uint32 field, float &v1, float &v2, float &v3, float &v4) const
 
bool getMatrix4x4 (uint32 field, float(&m)[16]) const
 
bool getVectorMatrix (uint32 field, std::vector< double > &vectorMatrix) const
 Return a field vector or a matrix type as a std::vector of doubles. More...
 
bool getVectorMatrix (uint32 field, std::vector< float > &vectorMatrix) const
 Return a field vector or a matrix type as a std::vector of doubles. More...
 
bool getMatrix4x4 (uint32 field, glm::mat4 &m) const
 
bool getUint (uint32 field, std::vector< uint64 > &list) const
 
bool getSint (uint32 field, std::vector< int64 > &list) const
 
bool getBool (uint32 field, std::vector< bool > &list) const
 
bool getDouble (uint32 field, std::vector< double > &list) const
 
bool getFloat (uint32 field, std::vector< float > &list) const
 
bool getString (uint32 field, Common::Encoding encoding, std::vector< Common::UString > &list) const
 Return field strings, read from the given encoding. More...
 
bool getString (uint32 field, std::vector< Common::UString > &list) const
 Return field strings, read from the default UTF-16LE encoding. More...
 
bool getTalkString (uint32 field, Common::Encoding encoding, std::vector< uint32 > &strRefs, std::vector< Common::UString > &strs) const
 Return field talk strings. More...
 
bool getTalkString (uint32 field, std::vector< uint32 > &strRefs, std::vector< Common::UString > &strs) const
 Return field talk strings. More...
 
bool getVectorMatrix (uint32 field, std::vector< std::vector< double > > &list) const
 Return field vector or a matrix types as std::vectors of doubles. More...
 
bool getVectorMatrix (uint32 field, std::vector< std::vector< float > > &list) const
 Return field vector or a matrix types as std::vectors of floats. More...
 
bool getMatrix4x4 (uint32 field, std::vector< glm::mat4 > &list) const
 
const GFF4StructgetStruct (uint32 field) const
 
const GFF4StructgetGeneric (uint32 field) const
 
const GFF4ListgetList (uint32 field) const
 
Common::SeekableReadStreamgetData (uint32 field) const
 Return the raw data of the field as a Seekable(Sub)ReadStream. More...
 

Private Types

typedef std::map< uint32, FieldFieldMap
 

Private Member Functions

 GFF4Struct (GFF4File &parent, uint32 offset, const GFF4File::StructTemplate &tmplt)
 Load a GFF4 struct. More...
 
 GFF4Struct (GFF4File &parent, const Field &genericParent)
 Load a GFF4 generic as a struct. More...
 
 ~GFF4Struct ()
 
void load (GFF4File &parent, uint32 offset, const GFF4File::StructTemplate &tmplt)
 
void loadStructs (GFF4File &parent, Field &field)
 
void loadGeneric (GFF4File &parent, Field &field)
 
void load (GFF4File &parent, const Field &genericParent)
 
const FieldgetField (uint32 field) const
 
uint32 getDataOffset (bool isReference, uint32 offset) const
 
uint32 getDataOffset (const Field &field) const
 
Common::SeekableSubReadStreamEndiangetData (const Field &field) const
 
Common::SeekableSubReadStreamEndiangetField (uint32 fieldID, const Field *&field) const
 
uint32 getListCount (Common::SeekableSubReadStreamEndian &data, const Field &field) const
 
uint32 getFieldSize (FieldType type) const
 
uint64 getUint (Common::SeekableSubReadStreamEndian &data, FieldType type) const
 
int64 getSint (Common::SeekableSubReadStreamEndian &data, FieldType type) const
 
double getDouble (Common::SeekableSubReadStreamEndian &data, FieldType type) const
 
float getFloat (Common::SeekableSubReadStreamEndian &data, FieldType type) const
 
Common::UString getString (Common::SeekableSubReadStreamEndian &data, Common::Encoding encoding) const
 
Common::UString getString (Common::SeekableSubReadStreamEndian &data, Common::Encoding encoding, uint32 offset) const
 
Common::UString getString (Common::SeekableSubReadStreamEndian &data, const Field &field, Common::Encoding encoding) const
 
uint32 getVectorMatrixLength (const Field &field, uint32 minLength, uint32 maxLength) const
 

Static Private Member Functions

static uint64 generateID (uint32 offset, const GFF4File::StructTemplate *tmplt=0)
 

Private Attributes

const GFF4File_parent
 
uint32 _label
 
uint64 _id
 
uint32 _refCount
 
size_t _fieldCount
 
FieldMap _fields
 
std::vector< uint32_fieldLabels
 The labels of all fields in this struct. More...
 

Friends

class GFF4File
 

Detailed Description

Definition at line 204 of file gff4file.h.

Member Typedef Documentation

◆ FieldMap

typedef std::map<uint32, Field> Aurora::GFF4Struct::FieldMap
private

Definition at line 370 of file gff4file.h.

Member Enumeration Documentation

◆ FieldType

The type of a GFF4 field.

Enumerator
kFieldTypeNone 

Invalid type.

kFieldTypeUint8 

Unsigned 8bit integer.

kFieldTypeSint8 

Signed 8bit integer.

kFieldTypeUint16 

Unsigned 16bit integer.

kFieldTypeSint16 

Signed 16bit integer.

kFieldTypeUint32 

Unsigned 32bit integer.

kFieldTypeSint32 

Signed 32bit integer.

kFieldTypeUint64 

Unsigned 64bit integer.

kFieldTypeSint64 

Signed 64bit integer.

kFieldTypeFloat32 

32bit IEEE float.

kFieldTypeFloat64 

64bit IEEE float (double).

kFieldTypeVector3f 

3 IEEE floats, 3D vector.

kFieldTypeVector4f 

4 IEEE floats, 4D vector.

kFieldTypeQuaternionf 

4 IEEE floats, Quaternion rotation.

kFieldTypeString 

A string.

kFieldTypeColor4f 

4 IEEE floats, RGBA color.

kFieldTypeMatrix4x4f 

16 IEEE floats, 4x4 matrix in row-major order.

kFieldTypeTlkString 

2 unsigned 32bit integers, reference into the TLK table.

kFieldTypeNDSFixed 

A 32bit fixed-point value, found in Sonic.

kFieldTypeASCIIString 

ASCII string, found in Sonic.

kFieldTypeStruct 

A struct.

kFieldTypeGeneric 

A "generic" field, able to hold any other type.

Definition at line 207 of file gff4file.h.

Constructor & Destructor Documentation

◆ GFF4Struct() [1/2]

Aurora::GFF4Struct::GFF4Struct ( GFF4File parent,
uint32  offset,
const GFF4File::StructTemplate tmplt 
)
private

Load a GFF4 struct.

Definition at line 374 of file gff4file.cpp.

References _id, generateID(), load(), Aurora::GFF4File::registerStruct(), and Aurora::GFF4File::unregisterStruct().

Referenced by loadGeneric(), and loadStructs().

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

◆ GFF4Struct() [2/2]

Aurora::GFF4Struct::GFF4Struct ( GFF4File parent,
const Field genericParent 
)
private

Load a GFF4 generic as a struct.

Definition at line 390 of file gff4file.cpp.

References _id, generateID(), load(), Aurora::GFF4Struct::Field::offset, Aurora::GFF4File::registerStruct(), and Aurora::GFF4File::unregisterStruct().

Here is the call graph for this function:

◆ ~GFF4Struct()

Aurora::GFF4Struct::~GFF4Struct ( )
private

Definition at line 406 of file gff4file.cpp.

Member Function Documentation

◆ generateID()

uint64 Aurora::GFF4Struct::generateID ( uint32  offset,
const GFF4File::StructTemplate tmplt = 0 
)
staticprivate

Definition at line 556 of file gff4file.cpp.

References Aurora::GFF4File::StructTemplate::index.

Referenced by GFF4Struct(), loadGeneric(), and loadStructs().

Here is the caller graph for this function:

◆ getBool() [1/2]

bool Aurora::GFF4Struct::getBool ( uint32  field,
bool  def = false 
) const

Definition at line 921 of file gff4file.cpp.

References getUint().

Here is the call graph for this function:

◆ getBool() [2/2]

bool Aurora::GFF4Struct::getBool ( uint32  field,
std::vector< bool > &  list 
) const

Definition at line 1182 of file gff4file.cpp.

References getField(), getListCount(), getUint(), and Aurora::GFF4Struct::Field::type.

Here is the call graph for this function:

◆ getData() [1/2]

Common::SeekableReadStream * Aurora::GFF4Struct::getData ( uint32  field) const

Return the raw data of the field as a Seekable(Sub)ReadStream.

Dangerous.

Definition at line 1407 of file gff4file.cpp.

References getField(), getFieldSize(), getListCount(), Common::SeekableSubReadStream::pos(), Common::SeekableSubReadStream::size(), and Aurora::GFF4Struct::Field::type.

Referenced by getField(), and Graphics::Aurora::ModelNode_DragonAge::readMesh().

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

◆ getData() [2/2]

Common::SeekableSubReadStreamEndian * Aurora::GFF4Struct::getData ( const Field field) const
private

Definition at line 638 of file gff4file.cpp.

References _parent, getDataOffset(), and Aurora::GFF4File::getStream().

Here is the call graph for this function:

◆ getDataOffset() [1/2]

uint32 Aurora::GFF4Struct::getDataOffset ( bool  isReference,
uint32  offset 
) const
private

Definition at line 618 of file gff4file.cpp.

References _parent, Aurora::GFF4File::getDataOffset(), Aurora::GFF4File::getStream(), and Common::SeekableSubReadStreamEndian::readUint32().

Referenced by getData(), getDataOffset(), load(), loadGeneric(), and loadStructs().

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

◆ getDataOffset() [2/2]

uint32 Aurora::GFF4Struct::getDataOffset ( const Field field) const
private

◆ getDouble() [1/3]

double Aurora::GFF4Struct::getDouble ( uint32  field,
double  def = 0.0 
) const

Definition at line 925 of file gff4file.cpp.

References getField(), Aurora::GFF4Struct::Field::isList, and Aurora::GFF4Struct::Field::type.

Referenced by getDouble(), Aurora::GDAFile::getFloat(), getMatrix4x4(), getVector3(), getVector4(), getVectorMatrix(), Engines::Sonic::Placeable::load(), and Aurora::TwoDAFile::load().

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

◆ getDouble() [2/3]

bool Aurora::GFF4Struct::getDouble ( uint32  field,
std::vector< double > &  list 
) const

Definition at line 1197 of file gff4file.cpp.

References getDouble(), getField(), getListCount(), and Aurora::GFF4Struct::Field::type.

Here is the call graph for this function:

◆ getDouble() [3/3]

double Aurora::GFF4Struct::getDouble ( Common::SeekableSubReadStreamEndian data,
FieldType  type 
) const
private

◆ getField() [1/2]

const GFF4Struct::Field * Aurora::GFF4Struct::getField ( uint32  field) const
private

◆ getField() [2/2]

Common::SeekableSubReadStreamEndian * Aurora::GFF4Struct::getField ( uint32  fieldID,
const Field *&  field 
) const
private

Definition at line 646 of file gff4file.cpp.

References getData(), and getField().

Here is the call graph for this function:

◆ getFieldCount()

size_t Aurora::GFF4Struct::getFieldCount ( ) const

Return the number of fields in this struct.

Definition at line 569 of file gff4file.cpp.

References _fieldCount.

◆ getFieldLabels()

const std::vector< uint32 > & Aurora::GFF4Struct::getFieldLabels ( ) const

Return a list of all field labels in this struct.

Definition at line 577 of file gff4file.cpp.

References _fieldLabels.

◆ getFieldProperties()

bool Aurora::GFF4Struct::getFieldProperties ( uint32  field,
FieldType type,
uint32 label,
bool &  isList 
) const

Collectively return all field properties in one go.

Returns
true if the field exists, false otherwise.

Definition at line 596 of file gff4file.cpp.

References getField(), Aurora::GFF4Struct::Field::isList, Aurora::GFF4Struct::Field::label, and Aurora::GFF4Struct::Field::type.

Here is the call graph for this function:

◆ getFieldSize()

uint32 Aurora::GFF4Struct::getFieldSize ( FieldType  type) const
private

◆ getFieldType() [1/2]

GFF4Struct::FieldType Aurora::GFF4Struct::getFieldType ( uint32  field) const

Return the type of this field, or kFieldTypeNone if it doesn't exist.

Definition at line 581 of file gff4file.cpp.

◆ getFieldType() [2/2]

GFF4Struct::FieldType Aurora::GFF4Struct::getFieldType ( uint32  field,
bool &  isList 
) const

Return the type of this field and whether it's list, or kFieldTypeNone if it doesn't exist.

Definition at line 586 of file gff4file.cpp.

References getField(), Aurora::GFF4Struct::Field::isList, kFieldTypeNone, and Aurora::GFF4Struct::Field::type.

Here is the call graph for this function:

◆ getFloat() [1/3]

float Aurora::GFF4Struct::getFloat ( uint32  field,
float  def = 0.0f 
) const

Definition at line 937 of file gff4file.cpp.

References getField(), Aurora::GFF4Struct::Field::isList, and Aurora::GFF4Struct::Field::type.

Referenced by getFloat(), getMatrix4x4(), getVector3(), getVector4(), and getVectorMatrix().

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

◆ getFloat() [2/3]

bool Aurora::GFF4Struct::getFloat ( uint32  field,
std::vector< float > &  list 
) const

Definition at line 1212 of file gff4file.cpp.

References getField(), getFloat(), getListCount(), and Aurora::GFF4Struct::Field::type.

Here is the call graph for this function:

◆ getFloat() [3/3]

float Aurora::GFF4Struct::getFloat ( Common::SeekableSubReadStreamEndian data,
FieldType  type 
) const
private

◆ getGeneric()

const GFF4Struct * Aurora::GFF4Struct::getGeneric ( uint32  field) const

Definition at line 1378 of file gff4file.cpp.

References getField(), kFieldTypeGeneric, Aurora::GFF4Struct::Field::structs, and Aurora::GFF4Struct::Field::type.

Referenced by Graphics::Aurora::Model_DragonAge::load().

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

◆ getID()

uint64 Aurora::GFF4Struct::getID ( ) const

Return the struct's unique ID within the GFF4.

Definition at line 409 of file gff4file.cpp.

References _id.

◆ getLabel()

uint32 Aurora::GFF4Struct::getLabel ( ) const

Return the struct's label.

The label is a (non-unique) 4-byte value, most often consisting of upper-case letters ([A-Z]), that can sometimes be used to identify the higher-level meaning of a struct within a GFF4.

It is read as a big-endian 32-bit integer value. See the MKTAG() macro, as defined in src/common/endianness.h, for generating values to compare it against.

The purpose of the label in a GFF4 struct is comparable to the ID in a GFF3 struct.

Definition at line 417 of file gff4file.cpp.

References _label.

◆ getList()

const GFF4List & Aurora::GFF4Struct::getList ( uint32  field) const

◆ getListCount()

uint32 Aurora::GFF4Struct::getListCount ( Common::SeekableSubReadStreamEndian data,
const Field field 
) const
private

◆ getMatrix4x4() [1/4]

bool Aurora::GFF4Struct::getMatrix4x4 ( uint32  field,
double(&)  m[16] 
) const

Definition at line 1073 of file gff4file.cpp.

References getDouble(), getField(), getVectorMatrixLength(), Aurora::GFF4Struct::Field::isList, and kFieldTypeFloat32.

Referenced by getMatrix4x4().

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

◆ getMatrix4x4() [2/4]

bool Aurora::GFF4Struct::getMatrix4x4 ( uint32  field,
float(&)  m[16] 
) const

Definition at line 1089 of file gff4file.cpp.

References getField(), getFloat(), getVectorMatrixLength(), Aurora::GFF4Struct::Field::isList, and kFieldTypeFloat32.

Here is the call graph for this function:

◆ getMatrix4x4() [3/4]

bool Aurora::GFF4Struct::getMatrix4x4 ( uint32  field,
glm::mat4 &  m 
) const

Definition at line 1105 of file gff4file.cpp.

References getMatrix4x4().

Here is the call graph for this function:

◆ getMatrix4x4() [4/4]

bool Aurora::GFF4Struct::getMatrix4x4 ( uint32  field,
std::vector< glm::mat4 > &  list 
) const

Definition at line 1336 of file gff4file.cpp.

References getField(), getFloat(), getListCount(), getVectorMatrixLength(), and kFieldTypeFloat32.

Here is the call graph for this function:

◆ getRefCount()

uint32 Aurora::GFF4Struct::getRefCount ( ) const

Return the number of structs that refer to this struct.

Definition at line 413 of file gff4file.cpp.

References _refCount.

◆ getSint() [1/3]

int64 Aurora::GFF4Struct::getSint ( uint32  field,
int64  def = 0 
) const

Definition at line 909 of file gff4file.cpp.

References getField(), Aurora::GFF4Struct::Field::isList, and Aurora::GFF4Struct::Field::type.

Referenced by Aurora::GDAFile::getInt(), getSint(), and Aurora::TwoDAFile::load().

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

◆ getSint() [2/3]

bool Aurora::GFF4Struct::getSint ( uint32  field,
std::vector< int64 > &  list 
) const

Definition at line 1167 of file gff4file.cpp.

References getField(), getListCount(), getSint(), and Aurora::GFF4Struct::Field::type.

Here is the call graph for this function:

◆ getSint() [3/3]

int64 Aurora::GFF4Struct::getSint ( Common::SeekableSubReadStreamEndian data,
FieldType  type 
) const
private

◆ getString() [1/7]

Common::UString Aurora::GFF4Struct::getString ( uint32  field,
Common::Encoding  encoding,
const Common::UString def = "" 
) const

◆ getString() [2/7]

Common::UString Aurora::GFF4Struct::getString ( uint32  field,
const Common::UString def = "" 
) const

Return a field string, read from the default UTF-16LE encoding.

Definition at line 963 of file gff4file.cpp.

References _parent, Aurora::GFF4File::getNativeEncoding(), and getString().

Here is the call graph for this function:

◆ getString() [3/7]

bool Aurora::GFF4Struct::getString ( uint32  field,
Common::Encoding  encoding,
std::vector< Common::UString > &  list 
) const

Return field strings, read from the given encoding.

Definition at line 1227 of file gff4file.cpp.

References getField(), getListCount(), getString(), and Aurora::GFF4Struct::Field::isList.

Here is the call graph for this function:

◆ getString() [4/7]

bool Aurora::GFF4Struct::getString ( uint32  field,
std::vector< Common::UString > &  list 
) const

Return field strings, read from the default UTF-16LE encoding.

Definition at line 1250 of file gff4file.cpp.

References _parent, Aurora::GFF4File::getNativeEncoding(), and getString().

Here is the call graph for this function:

◆ getString() [5/7]

Common::UString Aurora::GFF4Struct::getString ( Common::SeekableSubReadStreamEndian data,
Common::Encoding  encoding 
) const
private

◆ getString() [6/7]

Common::UString Aurora::GFF4Struct::getString ( Common::SeekableSubReadStreamEndian data,
Common::Encoding  encoding,
uint32  offset 
) const
private

Definition at line 858 of file gff4file.cpp.

References getString(), and Common::SeekableSubReadStream::seek().

Here is the call graph for this function:

◆ getString() [7/7]

Common::UString Aurora::GFF4Struct::getString ( Common::SeekableSubReadStreamEndian data,
const Field field,
Common::Encoding  encoding 
) const
private

◆ getStruct()

const GFF4Struct * Aurora::GFF4Struct::getStruct ( uint32  field) const

Definition at line 1360 of file gff4file.cpp.

References getField(), Aurora::GFF4Struct::Field::isList, kFieldTypeStruct, Aurora::GFF4Struct::Field::structs, and Aurora::GFF4Struct::Field::type.

Here is the call graph for this function:

◆ getTalkString() [1/4]

bool Aurora::GFF4Struct::getTalkString ( uint32  field,
Common::Encoding  encoding,
uint32 strRef,
Common::UString str 
) const

Return a talk string, which is a reference into the TalkTable and an optional direct string.

Definition at line 967 of file gff4file.cpp.

References _parent, Common::UString::clear(), Aurora::GFF4File::getDataOffset(), getField(), Aurora::GFF4File::getSharedString(), getString(), getUint(), Aurora::GFF4File::hasSharedStrings(), Aurora::GFF4Struct::Field::isList, kFieldTypeTlkString, kFieldTypeUint32, and Aurora::GFF4Struct::Field::type.

Referenced by getTalkString().

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

◆ getTalkString() [2/4]

bool Aurora::GFF4Struct::getTalkString ( uint32  field,
uint32 strRef,
Common::UString str 
) const

Return a talk string, which is a reference into the TalkTable and an optional direct string.

Definition at line 995 of file gff4file.cpp.

References _parent, Aurora::GFF4File::getNativeEncoding(), and getTalkString().

Here is the call graph for this function:

◆ getTalkString() [3/4]

bool Aurora::GFF4Struct::getTalkString ( uint32  field,
Common::Encoding  encoding,
std::vector< uint32 > &  strRefs,
std::vector< Common::UString > &  strs 
) const

◆ getTalkString() [4/4]

bool Aurora::GFF4Struct::getTalkString ( uint32  field,
std::vector< uint32 > &  strRefs,
std::vector< Common::UString > &  strs 
) const

Return field talk strings.

Definition at line 1290 of file gff4file.cpp.

References _parent, Aurora::GFF4File::getNativeEncoding(), and getTalkString().

Here is the call graph for this function:

◆ getUint() [1/3]

uint64 Aurora::GFF4Struct::getUint ( uint32  field,
uint64  def = 0 
) const

Definition at line 897 of file gff4file.cpp.

References getField(), Aurora::GFF4Struct::Field::isList, and Aurora::GFF4Struct::Field::type.

Referenced by getBool(), getTalkString(), getUint(), Engines::Sonic::Placeable::load(), Aurora::TwoDAFile::load(), and Aurora::TalkTable_GFF::readString05().

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

◆ getUint() [2/3]

bool Aurora::GFF4Struct::getUint ( uint32  field,
std::vector< uint64 > &  list 
) const

Definition at line 1152 of file gff4file.cpp.

References getField(), getListCount(), getUint(), and Aurora::GFF4Struct::Field::type.

Here is the call graph for this function:

◆ getUint() [3/3]

uint64 Aurora::GFF4Struct::getUint ( Common::SeekableSubReadStreamEndian data,
FieldType  type 
) const
private

◆ getVector3() [1/2]

bool Aurora::GFF4Struct::getVector3 ( uint32  field,
double &  v1,
double &  v2,
double &  v3 
) const

Definition at line 999 of file gff4file.cpp.

References getDouble(), getField(), getVectorMatrixLength(), Aurora::GFF4Struct::Field::isList, and kFieldTypeFloat32.

Referenced by Engines::Sonic::Placeable::load().

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

◆ getVector3() [2/2]

bool Aurora::GFF4Struct::getVector3 ( uint32  field,
float &  v1,
float &  v2,
float &  v3 
) const

Definition at line 1017 of file gff4file.cpp.

References getField(), getFloat(), getVectorMatrixLength(), Aurora::GFF4Struct::Field::isList, and kFieldTypeFloat32.

Here is the call graph for this function:

◆ getVector4() [1/2]

bool Aurora::GFF4Struct::getVector4 ( uint32  field,
double &  v1,
double &  v2,
double &  v3,
double &  v4 
) const

Definition at line 1035 of file gff4file.cpp.

References getDouble(), getField(), getVectorMatrixLength(), Aurora::GFF4Struct::Field::isList, and kFieldTypeFloat32.

Here is the call graph for this function:

◆ getVector4() [2/2]

bool Aurora::GFF4Struct::getVector4 ( uint32  field,
float &  v1,
float &  v2,
float &  v3,
float &  v4 
) const

Definition at line 1054 of file gff4file.cpp.

References getField(), getFloat(), getVectorMatrixLength(), Aurora::GFF4Struct::Field::isList, and kFieldTypeFloat32.

Here is the call graph for this function:

◆ getVectorMatrix() [1/4]

bool Aurora::GFF4Struct::getVectorMatrix ( uint32  field,
std::vector< double > &  vectorMatrix 
) const

Return a field vector or a matrix type as a std::vector of doubles.

Definition at line 1114 of file gff4file.cpp.

References getDouble(), getField(), getVectorMatrixLength(), Aurora::GFF4Struct::Field::isList, and kFieldTypeFloat32.

Here is the call graph for this function:

◆ getVectorMatrix() [2/4]

bool Aurora::GFF4Struct::getVectorMatrix ( uint32  field,
std::vector< float > &  vectorMatrix 
) const

Return a field vector or a matrix type as a std::vector of doubles.

Definition at line 1132 of file gff4file.cpp.

References getField(), getFloat(), getVectorMatrixLength(), Aurora::GFF4Struct::Field::isList, and kFieldTypeFloat32.

Here is the call graph for this function:

◆ getVectorMatrix() [3/4]

bool Aurora::GFF4Struct::getVectorMatrix ( uint32  field,
std::vector< std::vector< double > > &  list 
) const

Return field vector or a matrix types as std::vectors of doubles.

Definition at line 1296 of file gff4file.cpp.

References getDouble(), getField(), getListCount(), getVectorMatrixLength(), and kFieldTypeFloat32.

Here is the call graph for this function:

◆ getVectorMatrix() [4/4]

bool Aurora::GFF4Struct::getVectorMatrix ( uint32  field,
std::vector< std::vector< float > > &  list 
) const

Return field vector or a matrix types as std::vectors of floats.

Definition at line 1316 of file gff4file.cpp.

References getField(), getFloat(), getListCount(), getVectorMatrixLength(), and kFieldTypeFloat32.

Here is the call graph for this function:

◆ getVectorMatrixLength()

uint32 Aurora::GFF4Struct::getVectorMatrixLength ( const Field field,
uint32  minLength,
uint32  maxLength 
) const
private

◆ hasField()

bool Aurora::GFF4Struct::hasField ( uint32  field) const

Does this specific field exist?

Definition at line 573 of file gff4file.cpp.

References getField().

Referenced by Engines::Sonic::Placeable::load(), Aurora::TalkTable_GFF::load02(), Aurora::TalkTable_GFF::load05(), Engines::Sonic::Area::loadLayout(), Engines::DragonAge::Object::readVarTable(), and Engines::DragonAge2::Object::readVarTable().

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

◆ load() [1/2]

void Aurora::GFF4Struct::load ( GFF4File parent,
uint32  offset,
const GFF4File::StructTemplate tmplt 
)
private

◆ load() [2/2]

void Aurora::GFF4Struct::load ( GFF4File parent,
const Field genericParent 
)
private

◆ loadGeneric()

void Aurora::GFF4Struct::loadGeneric ( GFF4File parent,
Field field 
)
private

Definition at line 498 of file gff4file.cpp.

References _refCount, Aurora::GFF4File::findStruct(), generateID(), getDataOffset(), GFF4Struct(), Aurora::GFF4Struct::Field::isList, Aurora::GFF4Struct::Field::offset, and Aurora::GFF4Struct::Field::structs.

Referenced by load().

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

◆ loadStructs()

void Aurora::GFF4Struct::loadStructs ( GFF4File parent,
Field field 
)
private

Friends And Related Function Documentation

◆ GFF4File

friend class GFF4File
friend

Definition at line 434 of file gff4file.h.

Member Data Documentation

◆ _fieldCount

size_t Aurora::GFF4Struct::_fieldCount
private

Definition at line 380 of file gff4file.h.

Referenced by getFieldCount(), and load().

◆ _fieldLabels

std::vector<uint32> Aurora::GFF4Struct::_fieldLabels
private

The labels of all fields in this struct.

Definition at line 385 of file gff4file.h.

Referenced by getFieldLabels(), and load().

◆ _fields

FieldMap Aurora::GFF4Struct::_fields
private

Definition at line 382 of file gff4file.h.

Referenced by getField(), and load().

◆ _id

uint64 Aurora::GFF4Struct::_id
private

Definition at line 377 of file gff4file.h.

Referenced by getID(), and GFF4Struct().

◆ _label

uint32 Aurora::GFF4Struct::_label
private

Definition at line 375 of file gff4file.h.

Referenced by getLabel().

◆ _parent

const GFF4File* Aurora::GFF4Struct::_parent
private

Definition at line 373 of file gff4file.h.

Referenced by getData(), getDataOffset(), getListCount(), getString(), and getTalkString().

◆ _refCount

uint32 Aurora::GFF4Struct::_refCount
private

Definition at line 378 of file gff4file.h.

Referenced by getRefCount(), loadGeneric(), Aurora::GFF4File::loadStructs(), and loadStructs().


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