V-Gears 0
Free Final Fantasy VII engine.
XmlFile Class Reference

Handles XML files. More...

#include <XmlFile.h>

Inheritance diagram for XmlFile:

Public Member Functions

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

Protected Attributes

bool normal_file_
 Indicates if the file is a normal file. More...
 
TiXmlDocument file_
 The XML file. More...
 

Detailed Description

Handles XML files.

Constructor & Destructor Documentation

◆ XmlFile()

XmlFile::XmlFile ( const Ogre::String &  file)

Constructor.

Parameters
[in]filePath to the XML file.

◆ ~XmlFile()

XmlFile::~XmlFile ( )
virtual

Destructor.

Member Function Documentation

◆ GetBool()

bool XmlFile::GetBool ( TiXmlNode *  node,
const Ogre::String &  tag,
bool  def = false 
) const

Retrieves a boolean from an XMl tag.

Parameters
[in]nodeThe XML node.
[in]tagThe name of the tag.
[in]defDefault value, in case the tag is not found or it's not a boolean value.
Returns
Boolean value of the tag. If it's not found or it's not a boolean, def is returned.

◆ GetColourValue()

const Ogre::ColourValue XmlFile::GetColourValue ( TiXmlNode *  node,
const Ogre::String &  tag,
const Ogre::ColourValue &  def = Ogre::ColourValue::ZERO 
) const

Retrieves a colour from an XMl tag.

Parameters
[in]nodeThe XML node.
[in]tagThe name of the tag.
[in]defDefault value, in case the tag is not found.
Returns
Colour in the tag. If it's not found, def is returned.

◆ GetFloat()

float XmlFile::GetFloat ( TiXmlNode *  node,
const Ogre::String &  tag,
float  def = 0.0f 
) const

Retrieves a defcimal from an XMl tag.

Parameters
[in]nodeThe XML node.
[in]tagThe name of the tag.
[in]defDefault value, in case the tag is not found or it's not a numeric value.
Returns
Decimal value of the tag. If it's not found or it's not a number, def is returned.

◆ GetInt()

int XmlFile::GetInt ( TiXmlNode *  node,
const Ogre::String &  tag,
int  def = 0 
) const

Retrieves an integer from an XMl tag.

Parameters
[in]nodeThe XML node.
[in]tagThe name of the tag.
[in]defDefault value, in case the tag is not found or it's not a numeric value.
Returns
Integer value of the tag. If it's not found or it's not a number, def is returned.

◆ GetMatrix4()

const Ogre::Matrix4 XmlFile::GetMatrix4 ( TiXmlNode *  node,
const Ogre::String &  tag,
const Ogre::Matrix4 &  def = Ogre::Matrix4::IDENTITY 
) const

Retrieves a 4-dimensional matrix from an XMl tag.

Parameters
[in]nodeThe XML node.
[in]tagThe name of the tag.
[in]defDefault value, in case the tag is not found.
Returns
The matrix in the tag. If it's not found, def is returned.

◆ GetQuaternion()

const Ogre::Quaternion XmlFile::GetQuaternion ( TiXmlNode *  node,
const Ogre::String &  tag,
const Ogre::Quaternion &  def = Ogre::Quaternion::IDENTITY 
) const

Retrieves a quaternion from an XMl tag.

Parameters
[in]nodeThe XML node.
[in]tagThe name of the tag.
[in]defDefault value, in case the tag is not found.
Returns
Quaternion in the tag. If it's not found, def is returned.

◆ GetString()

const Ogre::String XmlFile::GetString ( TiXmlNode *  node,
const Ogre::String &  tag,
const Ogre::String &  def = "" 
) const

Retrieves a string from an XMl tag.

Parameters
[in]nodeThe XML node.
[in]tagThe name of the tag.
[in]defDefault value, in case the tag is not found.
Returns
String value of the tag. If it's not found, def is returned.

◆ GetUTFString()

const Ogre::UTFString XmlFile::GetUTFString ( TiXmlNode *  node,
const Ogre::String &  tag,
const Ogre::UTFString &  def = "" 
) const

Retrieves a string from an XMl tag.

Parameters
[in]nodeThe XML node.
[in]tagThe name of the tag.
[in]defDefault value, in case the tag is not found.
Returns
String value of the tag, in UFT8. If not found, def is returned.

◆ GetVector2()

const Ogre::Vector2 XmlFile::GetVector2 ( TiXmlNode *  node,
const Ogre::String &  tag,
const Ogre::Vector2 &  def = Ogre::Vector2::ZERO 
) const

Retrieves a 2-dimensional vector from an XMl tag.

Parameters
[in]nodeThe XML node.
[in]tagThe name of the tag.
[in]defDefault value, in case the tag is not found.
Returns
Vector in the tag. If it's not found, def is returned.

◆ GetVector3()

const Ogre::Vector3 XmlFile::GetVector3 ( TiXmlNode *  node,
const Ogre::String &  tag,
const Ogre::Vector3 &  def = Ogre::Vector3::ZERO 
) const

Retrieves a 3-dimensional vector from an XMl tag.

Parameters
[in]nodeThe XML node.
[in]tagThe name of the tag.
[in]defDefault value, in case the tag is not found.
Returns
Vector in the tag. If it's not found, def is returned.

◆ GetVector4()

const Ogre::Vector4 XmlFile::GetVector4 ( TiXmlNode *  node,
const Ogre::String &  tag,
const Ogre::Vector4 &  def = Ogre::Vector4::ZERO 
) const

Retrieves a 4-dimensional vector from an XMl tag.

Parameters
[in]nodeThe XML node.
[in]tagThe name of the tag.
[in]defDefault value, in case the tag is not found.
Returns
Vector in the tag. If it's not found, def is returned.

Member Data Documentation

◆ file_

TiXmlDocument XmlFile::file_
protected

The XML file.

◆ normal_file_

bool XmlFile::normal_file_
protected

Indicates if the file is a normal file.

Todo:
As opposed to what?

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