Interface providing easy read access to a XML file.
More...
#include <irrXML.h>
template<class char_type, class super_class>
class irr::io::IIrrXMLReader< char_type, super_class >
Interface providing easy read access to a XML file.
You can create an instance of this reader using one of the factory functions createIrrXMLReader(), createIrrXMLReaderUTF16() and createIrrXMLReaderUTF32(). If using the parser from the Irrlicht Engine, please use IFileSystem::createXMLReader() instead. For a detailed intro how to use the parser, see Example and Features.
The typical usage of this parser looks like this:
using namespace io;
void main()
{
if (xml == 0)
return;
while(xml->read())
{
}
delete xml;
}
See Example for a more detailed example.
Definition at line 277 of file irrXML.h.
◆ ~IIrrXMLReader()
template<class char_type , class super_class >
◆ getAttributeCount()
template<class char_type , class super_class >
Returns attribute count of the current XML node.
This is usually non null if the current node is EXN_ELEMENT, and the element has attributes.
- Returns
- Returns amount of attributes of this xml node.
◆ getAttributeName()
template<class char_type , class super_class >
Returns name of an attribute.
- Parameters
-
- Returns
- Name of the attribute, 0 if an attribute with this index does not exist.
◆ getAttributeValue() [1/2]
template<class char_type , class super_class >
Returns the value of an attribute.
- Parameters
-
- Returns
- Value of the attribute, 0 if an attribute with this index does not exist.
◆ getAttributeValue() [2/2]
template<class char_type , class super_class >
Returns the value of an attribute.
- Parameters
-
name | Name of the attribute. |
- Returns
- Value of the attribute, 0 if an attribute with this name does not exist.
◆ getAttributeValueAsFloat() [1/2]
template<class char_type , class super_class >
virtual float irr::io::IIrrXMLReader< char_type, super_class >::getAttributeValueAsFloat |
( |
const char_type * |
name, |
|
|
float |
defaultNotFound = 0.f |
|
) |
| const |
|
pure virtual |
Returns the value of an attribute as float.
- Parameters
-
name | Name of the attribute. |
defaultNotFound | Value returned when name does not exist. |
- Returns
- Value of the attribute as float or value of defaultNotFound parameter on failure or 0 when value could not be interpreted as float.
◆ getAttributeValueAsFloat() [2/2]
template<class char_type , class super_class >
virtual float irr::io::IIrrXMLReader< char_type, super_class >::getAttributeValueAsFloat |
( |
int |
idx, |
|
|
float |
defaultNotFound = 0.f |
|
) |
| const |
|
pure virtual |
Returns the value of an attribute as float.
- Parameters
-
idx | Zero based index, should be something between 0 and getAttributeCount()-1. |
defaultNotFound | Value returned when index does not exist. |
- Returns
- Value of the attribute as float or value of defaultNotFound parameter on failure or 0 when value could not be interpreted as float.
◆ getAttributeValueAsInt() [1/2]
template<class char_type , class super_class >
virtual int irr::io::IIrrXMLReader< char_type, super_class >::getAttributeValueAsInt |
( |
const char_type * |
name, |
|
|
int |
defaultNotFound = 0 |
|
) |
| const |
|
pure virtual |
Returns the value of an attribute as integer.
- Parameters
-
name | Name of the attribute. |
defaultNotFound | Value returned when name does not exist |
- Returns
- Value of the attribute as integer or value of defaultNotFound when name was not found or 0 when value could not be interpreted as integer
◆ getAttributeValueAsInt() [2/2]
template<class char_type , class super_class >
virtual int irr::io::IIrrXMLReader< char_type, super_class >::getAttributeValueAsInt |
( |
int |
idx, |
|
|
int |
defaultNotFound = 0 |
|
) |
| const |
|
pure virtual |
Returns the value of an attribute as integer.
- Parameters
-
idx | Zero based index, should be something between 0 and getAttributeCount()-1. |
defaultNotFound | Value returned when index does not exist. |
- Returns
- Value of the attribute as integer or value of defaultNotFound parameter for invalid index or 0 when value could not be interpreted as integer
◆ getAttributeValueSafe()
template<class char_type , class super_class >
Returns the value of an attribute in a safe way.
Like getAttributeValue(), but does not return 0 if the attribute does not exist. An empty string ("") is returned then.
- Parameters
-
name | Name of the attribute. |
- Returns
- Value of the attribute, and "" if an attribute with this name does not exist
◆ getNodeData()
template<class char_type , class super_class >
Returns data of the current node.
Only valid if the node has some data and it is of type EXN_TEXT, EXN_COMMENT, EXN_CDATA or EXN_UNKNOWN.
◆ getNodeName()
template<class char_type , class super_class >
Returns the name of the current node.
Only valid, if the node type is EXN_ELEMENT.
- Returns
- Name of the current node or 0 if the node has no name.
◆ getNodeType()
template<class char_type , class super_class >
Returns the type of the current XML node.
◆ getParserFormat()
template<class char_type , class super_class >
Returns format of the strings returned by the parser.
This will be UTF8 for example when you created a parser with IrrXMLReaderUTF8() and UTF32 when it has been created using IrrXMLReaderUTF32. It should not be necessary to call this method and only exists for informational purposes.
◆ getSourceFormat()
template<class char_type , class super_class >
Returns format of the source xml file.
It is not necessary to use this method because the parser will convert the input file format to the format wanted by the user when creating the parser. This method is useful to get/display additional information.
◆ isEmptyElement()
template<class char_type , class super_class >
Returns if an element is an empty element, like <foo />
◆ read()
template<class char_type , class super_class >
Reads forward to the next xml node.
- Returns
- Returns false, if there was no further node.
The documentation for this class was generated from the following file: