Interface providing easy read access to a XML file. More...
#include <irrXML.h>
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 irrxmlexample and features.
The typical usage of this parser looks like this:
#include <irrXML.h> using namespace irr; // irrXML is located in the namespace irr::io using namespace io; void main() { // create the reader using one of the factory functions IrrXMLReader* xml = createIrrXMLReader("config.xml"); if (xml == 0) return; // file could not be opened // parse the file until end reached while(xml->read()) { // based on xml->getNodeType(), do something. } // delete the xml parser after usage delete xml; }
See irrxmlexample for a more detailed example.
virtual irr::io::IIrrXMLReader< char_type, super_class >::~IIrrXMLReader | ( | ) | [inline, virtual] |
virtual unsigned int irr::io::IIrrXMLReader< char_type, super_class >::getAttributeCount | ( | ) | const [pure virtual] |
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.
virtual const char_type* irr::io::IIrrXMLReader< char_type, super_class >::getAttributeName | ( | int | idx | ) | const [pure virtual] |
Returns name of an attribute.
idx,: | Zero based index, should be something between 0 and getAttributeCount()-1. |
virtual const char_type* irr::io::IIrrXMLReader< char_type, super_class >::getAttributeValue | ( | int | idx | ) | const [pure virtual] |
Returns the value of an attribute.
idx,: | Zero based index, should be something between 0 and getAttributeCount()-1. |
virtual const char_type* irr::io::IIrrXMLReader< char_type, super_class >::getAttributeValue | ( | const char_type * | name | ) | const [pure virtual] |
Returns the value of an attribute.
name,: | Name of the attribute. |
virtual float irr::io::IIrrXMLReader< char_type, super_class >::getAttributeValueAsFloat | ( | const char_type * | name | ) | const [pure virtual] |
Returns the value of an attribute as float.
name,: | Name of the attribute. |
virtual float irr::io::IIrrXMLReader< char_type, super_class >::getAttributeValueAsFloat | ( | int | idx | ) | const [pure virtual] |
Returns the value of an attribute as float.
idx,: | Zero based index, should be something between 0 and getAttributeCount()-1. |
virtual int irr::io::IIrrXMLReader< char_type, super_class >::getAttributeValueAsInt | ( | const char_type * | name | ) | const [pure virtual] |
Returns the value of an attribute as integer.
name | Name of the attribute. |
virtual int irr::io::IIrrXMLReader< char_type, super_class >::getAttributeValueAsInt | ( | int | idx | ) | const [pure virtual] |
Returns the value of an attribute as integer.
idx,: | Zero based index, should be something between 0 and getAttributeCount()-1. |
virtual const char_type* irr::io::IIrrXMLReader< char_type, super_class >::getAttributeValueSafe | ( | const char_type * | name | ) | const [pure virtual] |
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.
name,: | Name of the attribute. |
virtual const char_type* irr::io::IIrrXMLReader< char_type, super_class >::getNodeData | ( | ) | const [pure virtual] |
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.
virtual const char_type* irr::io::IIrrXMLReader< char_type, super_class >::getNodeName | ( | ) | const [pure virtual] |
Returns the name of the current node.
Only valid, if the node type is EXN_ELEMENT.
virtual EXML_NODE irr::io::IIrrXMLReader< char_type, super_class >::getNodeType | ( | ) | const [pure virtual] |
Returns the type of the current XML node.
virtual ETEXT_FORMAT irr::io::IIrrXMLReader< char_type, super_class >::getParserFormat | ( | ) | const [pure virtual] |
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.
virtual ETEXT_FORMAT irr::io::IIrrXMLReader< char_type, super_class >::getSourceFormat | ( | ) | const [pure virtual] |
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 informations.
virtual bool irr::io::IIrrXMLReader< char_type, super_class >::isEmptyElement | ( | ) | const [pure virtual] |
Returns if an element is an empty element, like <foo />
virtual bool irr::io::IIrrXMLReader< char_type, super_class >::read | ( | ) | [pure virtual] |
Reads forward to the next xml node.