![]() |
V-Gears 0
Free Final Fantasy VII engine.
|
Handles XML files. More...
#include <XmlFile.h>
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... | |
Handles XML files.
XmlFile::XmlFile | ( | const Ogre::String & | file | ) |
Constructor.
[in] | file | Path to the XML file. |
|
virtual |
Destructor.
bool XmlFile::GetBool | ( | TiXmlNode * | node, |
const Ogre::String & | tag, | ||
bool | def = false |
||
) | const |
Retrieves a boolean from an XMl tag.
[in] | node | The XML node. |
[in] | tag | The name of the tag. |
[in] | def | Default value, in case the tag is not found or it's not a boolean value. |
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.
[in] | node | The XML node. |
[in] | tag | The name of the tag. |
[in] | def | Default value, in case the tag is not found. |
float XmlFile::GetFloat | ( | TiXmlNode * | node, |
const Ogre::String & | tag, | ||
float | def = 0.0f |
||
) | const |
Retrieves a defcimal from an XMl tag.
[in] | node | The XML node. |
[in] | tag | The name of the tag. |
[in] | def | Default value, in case the tag is not found or it's not a numeric value. |
int XmlFile::GetInt | ( | TiXmlNode * | node, |
const Ogre::String & | tag, | ||
int | def = 0 |
||
) | const |
Retrieves an integer from an XMl tag.
[in] | node | The XML node. |
[in] | tag | The name of the tag. |
[in] | def | Default value, in case the tag is not found or it's not a numeric value. |
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.
[in] | node | The XML node. |
[in] | tag | The name of the tag. |
[in] | def | Default value, in case the tag is not found. |
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.
[in] | node | The XML node. |
[in] | tag | The name of the tag. |
[in] | def | Default value, in case the tag is not found. |
const Ogre::String XmlFile::GetString | ( | TiXmlNode * | node, |
const Ogre::String & | tag, | ||
const Ogre::String & | def = "" |
||
) | const |
Retrieves a string from an XMl tag.
[in] | node | The XML node. |
[in] | tag | The name of the tag. |
[in] | def | Default value, in case the tag is not found. |
const Ogre::UTFString XmlFile::GetUTFString | ( | TiXmlNode * | node, |
const Ogre::String & | tag, | ||
const Ogre::UTFString & | def = "" |
||
) | const |
Retrieves a string from an XMl tag.
[in] | node | The XML node. |
[in] | tag | The name of the tag. |
[in] | def | Default value, in case the tag is not found. |
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.
[in] | node | The XML node. |
[in] | tag | The name of the tag. |
[in] | def | Default value, in case the tag is not found. |
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.
[in] | node | The XML node. |
[in] | tag | The name of the tag. |
[in] | def | Default value, in case the tag is not found. |
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.
[in] | node | The XML node. |
[in] | tag | The name of the tag. |
[in] | def | Default value, in case the tag is not found. |
|
protected |
The XML file.
|
protected |
Indicates if the file is a normal file.