The Xml-Parser class.
More...
#include <XmlParser.h>
|
static bool | getBoolAttribute (XmlNode &xmlNode, const char *name, bool &val) |
| Will try to get a bool attribute value.
|
|
static bool | getDoubleAttribute (XmlNode &xmlNode, const char *name, double &val) |
| Will try to get a double attribute value.
|
|
static bool | getFloatAttribute (XmlNode &xmlNode, const char *name, float &val) |
| Will try to get a float attribute value.
|
|
static bool | getIntAttribute (XmlNode &xmlNode, const char *name, int &val) |
| Will try to get an int attribute value.
|
|
static bool | getRealAttribute (XmlNode &xmlNode, const char *name, ai_real &val) |
| Will try to get a real attribute value.
|
|
static bool | getStdStrAttribute (XmlNode &xmlNode, const char *name, std::string &val) |
| Will try to get a std::string attribute value.
|
|
static bool | getUIntAttribute (XmlNode &xmlNode, const char *name, unsigned int &val) |
| Will try to get an unsigned int attribute value.
|
|
static bool | getValueAsBool (XmlNode &node, bool &v) |
| Will try to get the value of the node as an bool.
|
|
static bool | getValueAsFloat (XmlNode &node, float &v) |
| Will try to get the value of the node as a float.
|
|
static bool | getValueAsInt (XmlNode &node, int &v) |
| Will try to get the value of the node as an integer.
|
|
static bool | getValueAsReal (XmlNode &node, ai_real &v) |
| Will try to get the value of the node as a real.
|
|
static bool | getValueAsString (XmlNode &node, std::string &text) |
| Will try to get the value of the node as a string.
|
|
static bool | hasAttribute (XmlNode &xmlNode, const char *name) |
| Will check if an attribute is part of the XmlNode.
|
|
static bool | hasNode (XmlNode &node, const char *name) |
| Will check if a node with the given name is in.
|
|
The Xml-Parser class.
Use this parser if you have to import any kind of xml-format.
An example:
}
}
Definition Exceptional.h:121
- Template Parameters
-
◆ TXmlParser()
The default class constructor.
◆ ~TXmlParser()
◆ clear()
Will clear the parsed xml-file.
◆ findNode()
Will search for a child-node by its name.
- Parameters
-
[in] | name | The name of the child-node. |
- Returns
- The node instance or nullptr, if nothing was found.
◆ getBoolAttribute()
Will try to get a bool attribute value.
- Parameters
-
[in] | xmlNode | The node to search in. |
[in] | name | The attribute name to look for. |
[out] | val | The bool value from the attribute. |
- Returns
- true, if the node contains an attribute with the given name and if the value is a bool.
◆ getDocument()
Will return the document pointer, is nullptr if no xml-file was parsed.
- Returns
- The pointer showing to the document.
◆ getDoubleAttribute()
Will try to get a double attribute value.
- Parameters
-
[in] | xmlNode | The node to search in. |
[in] | name | The attribute name to look for. |
[out] | val | The double value from the attribute. |
- Returns
- true, if the node contains an attribute with the given name and if the value is a double.
◆ getFloatAttribute()
Will try to get a float attribute value.
- Parameters
-
[in] | xmlNode | The node to search in. |
[in] | name | The attribute name to look for. |
[out] | val | The float value from the attribute. |
- Returns
- true, if the node contains an attribute with the given name and if the value is a float.
◆ getIntAttribute()
Will try to get an int attribute value.
- Parameters
-
[in] | xmlNode | The node to search in. |
[in] | name | The attribute name to look for. |
[out] | val | The int value from the attribute. |
- Returns
- true, if the node contains an attribute with the given name and if the value is an int.
◆ getRealAttribute()
Will try to get a real attribute value.
- Parameters
-
[in] | xmlNode | The node to search in. |
[in] | name | The attribute name to look for. |
[out] | val | The real value from the attribute. |
- Returns
- true, if the node contains an attribute with the given name and if the value is a real.
◆ getRootNode() [1/2]
Will return the root node, non-const version.
- Returns
- The root node.
◆ getRootNode() [2/2]
Will return the root node, const version.
- Returns
- The root node.
◆ getStdStrAttribute()
Will try to get a std::string attribute value.
- Parameters
-
[in] | xmlNode | The node to search in. |
[in] | name | The attribute name to look for. |
[out] | val | The std::string value from the attribute. |
- Returns
- true, if the node contains an attribute with the given name and if the value is a std::string.
◆ getUIntAttribute()
Will try to get an unsigned int attribute value.
- Parameters
-
[in] | xmlNode | The node to search in. |
[in] | name | The attribute name to look for. |
[out] | val | The unsigned int value from the attribute. |
- Returns
- true, if the node contains an attribute with the given name and if the value is an unsigned int.
◆ getValueAsBool()
Will try to get the value of the node as an bool.
- Parameters
-
[in] | node | The node to search in. |
[out] | v | The value as a bool. |
- Returns
- true, if the value can be read out.
◆ getValueAsFloat()
Will try to get the value of the node as a float.
- Parameters
-
[in] | node | The node to search in. |
[out] | | |
The value as a float.
- Returns
- true, if the value can be read out.
◆ getValueAsInt()
Will try to get the value of the node as an integer.
- Parameters
-
[in] | node | The node to search in. |
[out] | i | The value as a int. |
- Returns
- true, if the value can be read out.
◆ getValueAsReal()
Will try to get the value of the node as a real.
- Parameters
-
[in] | node | The node to search in. |
[out] | v | The value as a ai_real. |
- Returns
- true, if the value can be read out.
◆ getValueAsString()
Will try to get the value of the node as a string.
- Parameters
-
[in] | node | The node to search in. |
[out] | text | The value as a text. |
- Returns
- true, if the value can be read out.
◆ hasAttribute()
Will check if an attribute is part of the XmlNode.
- Parameters
-
[in] | xmlNode | The node to search in. |
[in] | name | The attribute name to look for. |
- Returns
- true, if the was found, false if not.
◆ hasNode() [1/2]
Will return true, if the node is a child-node.
- Parameters
-
[in] | name | The name of the child node to look for. |
- Returns
- true, if the node is a child-node or false if not.
◆ hasNode() [2/2]
Will check if a node with the given name is in.
- Parameters
-
[in] | node | The node to look in. |
[in] | name | The name of the child-node. |
- Returns
- true, if node was found, false if not.
◆ hasRoot()
Will return true if a root node is there.
- Returns
- true in case of an existing root.
◆ parse()
Will parse an xml-file from a given stream.
- Parameters
-
[in] | stream | The input stream. |
- Returns
- true, if the parsing was successful, false if not.
The documentation for this class was generated from the following file: