Assimp
v5.0.1. (December 2020)
|
The Xml-Parser class. More...
Public Member Functions | |
void | clear () |
Will clear the parsed xml-file. More... | |
TNodeType * | findNode (const std::string &name) |
Will search for a child-node by its name. More... | |
pugi::xml_document * | getDocument () const |
Will return the document pointer, is nullptr if no xml-file was parsed. More... | |
const TNodeType | getRootNode () const |
Will return the root node, const version. More... | |
TNodeType | getRootNode () |
Will return the root node, non-const version. More... | |
bool | hasNode (const std::string &name) |
Will return true, if the node is a child-node. More... | |
bool | hasRoot () const |
Will return truem if a root node is there. More... | |
bool | parse (IOStream *stream) |
Will parse an xml-file from a given stream. More... | |
TXmlParser () | |
The default class constructor. More... | |
~TXmlParser () | |
The class destructor. More... | |
Static Public Member Functions | |
static bool | getBoolAttribute (XmlNode &xmlNode, const char *name, bool &val) |
Will try to get a bool attribute value. More... | |
static bool | getDoubleAttribute (XmlNode &xmlNode, const char *name, double &val) |
Will try to get a double attribute value. More... | |
static bool | getFloatAttribute (XmlNode &xmlNode, const char *name, float &val) |
Will try to get a float attribute value. More... | |
static bool | getIntAttribute (XmlNode &xmlNode, const char *name, int &val) |
Will try to get an int attribute value. More... | |
static bool | getRealAttribute (XmlNode &xmlNode, const char *name, ai_real &val) |
Will try to get a real attribute value. More... | |
static bool | getStdStrAttribute (XmlNode &xmlNode, const char *name, std::string &val) |
Will try to get a std::string attribute value. More... | |
static bool | getUIntAttribute (XmlNode &xmlNode, const char *name, unsigned int &val) |
Will try to get an unsigned int attribute value. More... | |
static bool | getValueAsBool (XmlNode &node, bool &v) |
Will try to get the value of the node as an bool. More... | |
static bool | getValueAsFloat (XmlNode &node, ai_real &v) |
Will try to get the value of the node as a float. More... | |
static bool | getValueAsInt (XmlNode &node, int &v) |
Will try to get the value of the node as an integer. More... | |
static bool | getValueAsString (XmlNode &node, std::string &text) |
Will try to get the value of the node as a string. More... | |
static bool | hasAttribute (XmlNode &xmlNode, const char *name) |
Will check if an attribute is part of the XmlNode. More... | |
static bool | hasNode (XmlNode &node, const char *name) |
Will check if a node with the given name is in. More... | |
The Xml-Parser class.
Use this parser if you have to import any kind of xml-format.
An example:
TNodeType |
|
inline |
The default class constructor.
|
inline |
The class destructor.
|
inline |
Will clear the parsed xml-file.
|
inline |
Will search for a child-node by its name.
name | [in] The name of the child-node. |
|
inlinestatic |
Will try to get a bool attribute value.
xmlNode | [in] The node to search in. |
name | [in] The attribute name to look for. |
val | [out] The bool value from the attribute. |
|
inline |
Will return the document pointer, is nullptr if no xml-file was parsed.
|
inlinestatic |
Will try to get a double attribute value.
xmlNode | [in] The node to search in. |
name | [in] The attribute name to look for. |
val | [out] The double value from the attribute. |
|
inlinestatic |
Will try to get a float attribute value.
xmlNode | [in] The node to search in. |
name | [in] The attribute name to look for. |
val | [out] The float value from the attribute. |
|
inlinestatic |
Will try to get an int attribute value.
xmlNode | [in] The node to search in. |
name | [in] The attribute name to look for. |
val | [out] The int value from the attribute. |
|
inlinestatic |
Will try to get a real attribute value.
xmlNode | [in] The node to search in. |
name | [in] The attribute name to look for. |
val | [out] The real value from the attribute. |
|
inline |
Will return the root node, const version.
|
inline |
Will return the root node, non-const version.
|
inlinestatic |
Will try to get a std::string attribute value.
xmlNode | [in] The node to search in. |
name | [in] The attribute name to look for. |
val | [out] The std::string value from the attribute. |
|
inlinestatic |
Will try to get an unsigned int attribute value.
xmlNode | [in] The node to search in. |
name | [in] The attribute name to look for. |
val | [out] The unsigned int value from the attribute. |
|
inlinestatic |
Will try to get the value of the node as an bool.
node | [in] The node to search in. |
text | [out] The value as a bool. |
|
inlinestatic |
Will try to get the value of the node as a float.
node | [in] The node to search in. |
text | [out] The value as a float. |
|
inlinestatic |
Will try to get the value of the node as an integer.
node | [in] The node to search in. |
text | [out] The value as a int. |
|
inlinestatic |
Will try to get the value of the node as a string.
node | [in] The node to search in. |
text | [out] The value as a text. |
|
inlinestatic |
Will check if an attribute is part of the XmlNode.
xmlNode | [in] The node to search in. |
name | [in} The attribute name to look for. |
|
inline |
Will return true, if the node is a child-node.
name | [in] The name of the child node to look for. |
|
inlinestatic |
Will check if a node with the given name is in.
node | [in] The node to look in. |
name | [in] The name of the child-node. |
|
inline |
Will return truem if a root node is there.
|
inline |
Will parse an xml-file from a given stream.
stream | The input stream. |