V-Gears 0
Free Final Fantasy VII engine.
VGears::FF7Metadata Class Reference

Handles Final Fantasy VII Metadata. More...

#include <FF7NameLookup.h>

Inheritance diagram for VGears::FF7Metadata:
Collaboration diagram for VGears::FF7Metadata:

Classes

struct  FieldMetaData
 A field metadata representation. More...
 

Public Member Functions

 FF7Metadata (Ogre::String file)
 Constructor. More...
 
const StringAnimation (const String &key) const
 Matches animation names. More...
 
const StringModel (const String &key) const
 Matches model names. More...
 
- Public Member Functions inherited from XmlFile
 XmlFile (const Ogre::String &file)
 Constructor. More...
 
virtual ~XmlFile ()
 Destructor. More...
 
bool GetBool (TiXmlNode *node, const Ogre::String &tag, bool def=false) const
 Retrieves a boolean from an XMl tag. More...
 
int GetInt (TiXmlNode *node, const Ogre::String &tag, int def=0) const
 Retrieves an integer from an XMl tag. More...
 
float GetFloat (TiXmlNode *node, const Ogre::String &tag, float def=0.0f) const
 Retrieves a defcimal from an XMl tag. More...
 
const Ogre::String GetString (TiXmlNode *node, const Ogre::String &tag, const Ogre::String &def="") const
 Retrieves a string from an XMl tag. More...
 
const Ogre::UTFString GetUTFString (TiXmlNode *node, const Ogre::String &tag, const Ogre::UTFString &def="") const
 Retrieves a string from an XMl tag. More...
 
const Ogre::Vector2 GetVector2 (TiXmlNode *node, const Ogre::String &tag, const Ogre::Vector2 &def=Ogre::Vector2::ZERO) const
 Retrieves a 2-dimensional vector from an XMl tag. More...
 
const Ogre::Vector3 GetVector3 (TiXmlNode *node, const Ogre::String &tag, const Ogre::Vector3 &def=Ogre::Vector3::ZERO) const
 Retrieves a 3-dimensional vector from an XMl tag. More...
 
const Ogre::Vector4 GetVector4 (TiXmlNode *node, const Ogre::String &tag, const Ogre::Vector4 &def=Ogre::Vector4::ZERO) const
 Retrieves a 4-dimensional vector from an XMl tag. More...
 
const Ogre::Matrix4 GetMatrix4 (TiXmlNode *node, const Ogre::String &tag, const Ogre::Matrix4 &def=Ogre::Matrix4::IDENTITY) const
 Retrieves a 4-dimensional matrix from an XMl tag. More...
 
const Ogre::Quaternion GetQuaternion (TiXmlNode *node, const Ogre::String &tag, const Ogre::Quaternion &def=Ogre::Quaternion::IDENTITY) const
 Retrieves a quaternion from an XMl tag. More...
 
const Ogre::ColourValue GetColourValue (TiXmlNode *node, const Ogre::String &tag, const Ogre::ColourValue &def=Ogre::ColourValue::ZERO) const
 Retrieves a colour from an XMl tag. More...
 

Private Types

typedef std::map< String, StringLookupMap
 

Private Member Functions

void ReadModels (TiXmlNode *node)
 Reads all models from an XML node. More...
 
void ReadAnimations (TiXmlNode *node)
 Reads all models from an XML node. More...
 
void ReadScripts (TiXmlNode *node)
 Reads all scripts from an XML node. More...
 
void ReadField (TiXmlNode *node, const std::string &name)
 Reads field information from an XML node. More...
 
void ReadFunction (TiXmlNode *node, const std::string &field_name)
 Reads a function of a field from an XML node. More...
 
void ReadEntityNames (TiXmlNode *node)
 Reads all entity from an XML node. More...
 
void ReadVarNames (TiXmlNode *node)
 Reads all variable names from an XML node. More...
 
void ReadCharacterIds (TiXmlNode *node)
 Reads all character identifiers from an XML node. More...
 
std::pair< String, StringFieldScriptFunctionData (const String &field_name, const String &entity_name, const String &old_function_name)
 Retrieves a field script function data. More...
 

Private Attributes

LookupMap models_
 The list of models. More...
 
LookupMap animations_
 The list of animations. More...
 
std::map< int, Stringcharacter_ids_
 Character identifier map. More...
 
std::map< int, std::map< int, String > > var_map_
 Variable map. More...
 
LookupMap entity_name_map_
 Entity name map. More...
 
std::map< String, FieldMetaDatafield_data_
 

Friends

class NameLookup
 

Additional Inherited Members

- Protected Attributes inherited from XmlFile
bool normal_file_
 Indicates if the file is a normal file. More...
 
TiXmlDocument file_
 The XML file. More...
 

Detailed Description

Handles Final Fantasy VII Metadata.

Member Typedef Documentation

◆ LookupMap

typedef std::map<String, String> VGears::FF7Metadata::LookupMap
private

Constructor & Destructor Documentation

◆ FF7Metadata()

VGears::FF7Metadata::FF7Metadata ( Ogre::String  file)
inline

Constructor.

Parameters
[in]fileThe XML file.

Member Function Documentation

◆ Animation()

const String & VGears::FF7Metadata::Animation ( const String key) const
inline

Matches animation names.

Looks for defined names associated to the original game animation names. Defined names are more user friendly, more readable and more descriptive.

Parameters
[in]keyOriginal game animation name.
Returns
Friendly name associated to the animation, or the original name if there is no name associated.

◆ FieldScriptFunctionData()

std::pair< String, String > VGears::FF7Metadata::FieldScriptFunctionData ( const String field_name,
const String entity_name,
const String old_function_name 
)
inlineprivate

Retrieves a field script function data.

Parameters
[in]field_nameThe name of the field from witch to get the data.
[in]entity_nameName of the entity rom witch to get the data.
[in]old_function_nameThe original function name.
Returns
Associated function name pair. An empty pair if the field, entity or function don't exist.
Todo:
Verify documentation for old_function name and return value.

◆ Model()

const String & VGears::FF7Metadata::Model ( const String key) const
inline

Matches model names.

Looks for defined names associated to the original game model names. Defined names are more user friendly, more readable and more descriptive.

Parameters
[in]keyOriginal game model name.
Returns
Friendly name associated to the model, or the original name if there is no name associated.

◆ ReadAnimations()

void VGears::FF7Metadata::ReadAnimations ( TiXmlNode *  node)
inlineprivate

Reads all models from an XML node.

Parameters
[in]nodeXML node to read.

◆ ReadCharacterIds()

void VGears::FF7Metadata::ReadCharacterIds ( TiXmlNode *  node)
inlineprivate

Reads all character identifiers from an XML node.

Parameters
[in]nodeXML node to read.

◆ ReadEntityNames()

void VGears::FF7Metadata::ReadEntityNames ( TiXmlNode *  node)
inlineprivate

Reads all entity from an XML node.

Parameters
[in]nodeXML node to read.

◆ ReadField()

void VGears::FF7Metadata::ReadField ( TiXmlNode *  node,
const std::string &  name 
)
inlineprivate

Reads field information from an XML node.

Parameters
[in]nodeXML node to read.
[in]nameUnused.

◆ ReadFunction()

void VGears::FF7Metadata::ReadFunction ( TiXmlNode *  node,
const std::string &  field_name 
)
inlineprivate

Reads a function of a field from an XML node.

Parameters
[in]nodeXML node to read.
[in]field_nameThe anme of the field.

◆ ReadModels()

void VGears::FF7Metadata::ReadModels ( TiXmlNode *  node)
inlineprivate

Reads all models from an XML node.

Parameters
[in]nodeXML node to read.

◆ ReadScripts()

void VGears::FF7Metadata::ReadScripts ( TiXmlNode *  node)
inlineprivate

Reads all scripts from an XML node.

Parameters
[in]nodeXML node to read.

◆ ReadVarNames()

void VGears::FF7Metadata::ReadVarNames ( TiXmlNode *  node)
inlineprivate

Reads all variable names from an XML node.

Parameters
[in]nodeXML node to read.

Friends And Related Function Documentation

◆ NameLookup

friend class NameLookup
friend

Member Data Documentation

◆ animations_

LookupMap VGears::FF7Metadata::animations_
private

The list of animations.

◆ character_ids_

std::map<int, String> VGears::FF7Metadata::character_ids_
private

Character identifier map.

◆ entity_name_map_

LookupMap VGears::FF7Metadata::entity_name_map_
private

Entity name map.

◆ field_data_

std::map<String, FieldMetaData> VGears::FF7Metadata::field_data_
private

◆ models_

LookupMap VGears::FF7Metadata::models_
private

The list of models.

◆ var_map_

std::map<int, std::map<int, String> > VGears::FF7Metadata::var_map_
private

Variable map.


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