irrXML: irrXML 1.2 API documentation

irrXML 1.2 API documentation

Introduction

Welcome to the irrXML API documentation. Here you'll find any information you'll need to develop applications with irrXML. If you look for a tutorial on how to start, take a look at the Example, at the homepage of irrXML at xml.irrlicht3d.org or into the SDK in the directory

irrXML is intended to be a high speed and easy-to-use XML Parser for C++, and this documentation is an important part of it. If you have any questions or suggestions, just send a email to the author of the engine, Nikolaus Gebhardt (niko (at) irrlicht3d.org). For more informations about this parser, see History.

Features

irrXML provides forward-only, read-only access to a stream of non validated XML data. It was fully implemented by Nikolaus Gebhardt. Its current features are:

  • It it fast as lighting and has very low memory usage. It was developed with the intention of being used in 3D games, as it already has been.
  • irrXML is very small: It only consists of 60 KB of code and can be added easily to your existing project.
  • Of course, it is platform independent and works with lots of compilers.
  • It is able to parse ASCII, UTF-8, UTF-16 and UTF-32 text files, both in little and big endian format.
  • Independent of the input file format, the parser can return all strings in ASCII, UTF-8, UTF-16 and UTF-32 format.
  • With its optional file access abstraction it has the advantage that it can read not only from files but from any type of data (memory, network, ...). For example when used with the Irrlicht Engine, it directly reads from compressed .zip files.
  • Just like the Irrlicht Engine for which it was originally created, it is extremely easy to use.
  • It has no external dependencies, it does not even need the STL.

Although irrXML has some strenghts, it currently also has the following limitations:

  • The input xml file is not validated and assumed to be correct.

Example

The following code demonstrates the basic usage of irrXML. A simple xml file like this is parsed:
        <?xml version="1.0"?>
        <config>
                <!-- This is a config file for the mesh viewer -->
                <model file="dwarf.dea" />
                <messageText caption="Irrlicht Engine Mesh Viewer">
                Welcome to the Mesh Viewer of the &quot;Irrlicht Engine&quot;.
                </messageText>
        </config>

The code for parsing this file would look like this:

        #include <irrXML.h>
        using namespace irr; // irrXML is located in the namespace irr::io
        using namespace io;

        #include <string> // we use STL strings to store data in this example

        void main()
        {
                // create the reader using one of the factory functions

                IrrXMLReader* xml = createIrrXMLReader("config.xml");

                // strings for storing the data we want to get out of the file
                std::string modelFile;
                std::string messageText;
                std::string caption;

                // parse the file until end reached

                while(xml && xml->read())
                {
                        switch(xml->getNodeType())
                        {
                        case EXN_TEXT:
                                // in this xml file, the only text which occurs is the messageText
                                messageText = xml->getNodeData();
                                break;
                        case EXN_ELEMENT:
                                {
                                        if (!strcmp("model", xml->getNodeName()))
                                                modelFile = xml->getAttributeValue("file");
                                        else
                                        if (!strcmp("messageText", xml->getNodeName()))
                                                caption = xml->getAttributeValue("caption");
                                }
                                break;
                        }
                }

                // delete the xml parser after usage
                delete xml;
        }

How to use

Simply add the source files in the /src directory of irrXML to your project. Done.

License

The irrXML license is based on the zlib license. Basicly, this means you can do with irrXML whatever you want:

Copyright (C) 2002-2005 Nikolaus Gebhardt

This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software.

Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions:

1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.

2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.

3. This notice may not be removed or altered from any source distribution.

History

As lots of references in this documentation and the source show, this xml parser has originally been a part of the Irrlicht Engine. But because the parser has become very useful with the latest release, people asked for a separate version of it, to be able to use it in non Irrlicht projects. With irrXML 1.0, this has now been done.
irrXML
The irrXML Documentation © 2003-2005 by Nikolaus Gebhardt. Generated on Sat Nov 12 16:26:14 2005 by Doxygen (1.4.2)


irrXML: File Index

irrXML File List

Here is a list of all files with brief descriptions:
irrXML.h [code] Header file of the irrXML, the Irrlicht XML parser


irrXML: irrXML.h File Reference

irrXML.h File Reference

Header file of the irrXML, the Irrlicht XML parser. More...

#include <stdio.h>

Go to the source code of this file.

Namespaces

namespace | irr
namespace | irr::io

Typedefs

typedef unsigned short | char16
defines the utf-16 type.
typedef unsigned long | char32
defines the utf-32 type.
typedef IIrrXMLReader< char,
IXMLBase > 		IrrXMLReader
A UTF-8 or ASCII character xml parser.
typedef IIrrXMLReader< char16,
IXMLBase > 		IrrXMLReaderUTF16
A UTF-16 xml parser.
typedef IIrrXMLReader< char32,
IXMLBase > 		IrrXMLReaderUTF32
A UTF-32 xml parser.

Enumerations

enum ETEXT_FORMAT {
ETF_ASCII, ETF_UTF8, ETF_UTF16_BE, ETF_UTF16_LE,
ETF_UTF32_BE, ETF_UTF32_LE
}
Enumeration of all supported source text file formats. More...
enum EXML_NODE {
EXN_NONE, EXN_ELEMENT, EXN_ELEMENT_END, EXN_TEXT,
EXN_COMMENT, EXN_CDATA, EXN_UNKNOWN
}
Enumeration for all xml nodes which are parsed by IrrXMLReader. More...

Functions

IrrXMLReader * | createIrrXMLReader (IFileReadCallBack *callback)
Creates an instance of an UFT-8 or ASCII character xml parser.
IrrXMLReader * | createIrrXMLReader (FILE *file)
Creates an instance of an UFT-8 or ASCII character xml parser.
IrrXMLReader * | createIrrXMLReader (const char *filename)
Creates an instance of an UFT-8 or ASCII character xml parser.
IrrXMLReaderUTF16 * | createIrrXMLReaderUTF16 (IFileReadCallBack *callback)
Creates an instance of an UFT-16 xml parser.
IrrXMLReaderUTF16 * | createIrrXMLReaderUTF16 (FILE *file)
Creates an instance of an UFT-16 xml parser.
IrrXMLReaderUTF16 * | createIrrXMLReaderUTF16 (const char *filename)
Creates an instance of an UFT-16 xml parser.
IrrXMLReaderUTF32 * | createIrrXMLReaderUTF32 (IFileReadCallBack *callback)
Creates an instance of an UFT-32 xml parser.
IrrXMLReaderUTF32 * | createIrrXMLReaderUTF32 (FILE *file)
Creates an instance of an UFT-32 xml parser.
IrrXMLReaderUTF32 * | createIrrXMLReaderUTF32 (const char *filename)
Creates an instance of an UFT-32 xml parser.

Detailed Description

Header file of the irrXML, the Irrlicht XML parser.

This file includes everything needed for using irrXML, the XML parser of the Irrlicht Engine. To use irrXML, you only need to include this file in your project:

        #include <irrXML.h>

It is also common to use the two namespaces in which irrXML is included, directly after #including irrXML.h:

        #include <irrXML.h>
        using namespace irr;
        using namespace io;

Definition in file irrXML.h.

Typedef Documentation

typedef unsigned short irr::io::char16

defines the utf-16 type.

Not using wchar_t for this because wchar_t has 16 bit on windows and 32 bit on other operating systems.

Definition at line 371 of file irrXML.h.

typedef unsigned long irr::io::char32

defines the utf-32 type.

Not using wchar_t for this because wchar_t has 16 bit on windows and 32 bit on other operating systems.

Definition at line 376 of file irrXML.h.

typedef IIrrXMLReader<char, IXMLBase> irr::io::IrrXMLReader

A UTF-8 or ASCII character xml parser.

This means that all character data will be returned in 8 bit ASCII or UTF-8 by this parser. The file to read can be in any format, it will be converted to UTF-8 if it is not in this format. Create an instance of this with createIrrXMLReader(); See IIrrXMLReader for description on how to use it.

Definition at line 384 of file irrXML.h.

typedef IIrrXMLReader<char16, IXMLBase> irr::io::IrrXMLReaderUTF16

A UTF-16 xml parser.

This means that all character data will be returned in UTF-16 by this parser. The file to read can be in any format, it will be converted to UTF-16 if it is not in this format. Create an instance of this with createIrrXMLReaderUTF16(); See IIrrXMLReader for description on how to use it.

Definition at line 392 of file irrXML.h.

typedef IIrrXMLReader<char32, IXMLBase> irr::io::IrrXMLReaderUTF32

A UTF-32 xml parser.

This means that all character data will be returned in UTF-32 by this parser. The file to read can be in any format, it will be converted to UTF-32 if it is not in this format. Create an instance of this with createIrrXMLReaderUTF32(); See IIrrXMLReader for description on how to use it.

Definition at line 400 of file irrXML.h.

Enumeration Type Documentation

enum irr::io::ETEXT_FORMAT

Enumeration of all supported source text file formats.

Enumeration values:
ETF_ASCII | ASCII, file without byte order mark, or not a text file.
ETF_UTF8 | UTF-8 format.
ETF_UTF16_BE | UTF-16 format, big endian.
ETF_UTF16_LE | UTF-16 format, little endian.
ETF_UTF32_BE | UTF-32 format, big endian.
ETF_UTF32_LE | UTF-32 format, little endian.

Definition at line 157 of file irrXML.h.

enum irr::io::EXML_NODE

Enumeration for all xml nodes which are parsed by IrrXMLReader.

Enumeration values:
EXN_NONE | No xml node. This is usually the node if you did not read anything yet.
EXN_ELEMENT | A xml element, like <foo>.
EXN_ELEMENT_END | End of an xml element, like </foo>.
EXN_TEXT | Text within a xml element: <foo> this is the text. </foo>.
EXN_COMMENT | An xml comment like <!-- I am a comment --> or a DTD definition.
EXN_CDATA | An xml cdata section like <![CDATA[ this is some CDATA ]]>.
EXN_UNKNOWN | Unknown element.

Definition at line 180 of file irrXML.h.

Function Documentation

IrrXMLReader* irr::io::createIrrXMLReader ( IFileReadCallBack * callback )

Creates an instance of an UFT-8 or ASCII character xml parser.

This means that all character data will be returned in 8 bit ASCII or UTF-8. The file to read can be in any format, it will be converted to UTF-8 if it is not in this format. If you are using the Irrlicht Engine, it is better not to use this function but IFileSystem::createXMLReaderUTF8() instead.

Parameters:
callback,: Callback for file read abstraction. Implement your own callback to make the xml parser read in other things than just files. See IFileReadCallBack for more information about this.
Returns:
Returns a pointer to the created xml parser. This pointer should be deleted using 'delete' after no longer needed. Returns 0 if an error occured and the file could not be opened.

IrrXMLReader* irr::io::createIrrXMLReader ( FILE * file )

Creates an instance of an UFT-8 or ASCII character xml parser.

This means that all character data will be returned in 8 bit ASCII or UTF-8. The file to read can be in any format, it will be converted to UTF-8 if it is not in this format. If you are using the Irrlicht Engine, it is better not to use this function but IFileSystem::createXMLReaderUTF8() instead.

Parameters:
file,: Pointer to opened file, must have been opened in binary mode, e.g. using fopen("foo.bar", "wb"); The file will not be closed after it has been read.
Returns:
Returns a pointer to the created xml parser. This pointer should be deleted using 'delete' after no longer needed. Returns 0 if an error occured and the file could not be opened.

IrrXMLReader* irr::io::createIrrXMLReader ( const char * filename )

Creates an instance of an UFT-8 or ASCII character xml parser.

This means that all character data will be returned in 8 bit ASCII or UTF-8. The file to read can be in any format, it will be converted to UTF-8 if it is not in this format. If you are using the Irrlicht Engine, it is better not to use this function but IFileSystem::createXMLReaderUTF8() instead.

Parameters:
filename,: Name of file to be opened.
Returns:
Returns a pointer to the created xml parser. This pointer should be deleted using 'delete' after no longer needed. Returns 0 if an error occured and the file could not be opened.

IrrXMLReaderUTF16* irr::io::createIrrXMLReaderUTF16 ( IFileReadCallBack * callback )

Creates an instance of an UFT-16 xml parser.

This means that all character data will be returned in UTF-16. The file to read can be in any format, it will be converted to UTF-16 if it is not in this format. If you are using the Irrlicht Engine, it is better not to use this function but IFileSystem::createXMLReader() instead.

Parameters:
callback,: Callback for file read abstraction. Implement your own callback to make the xml parser read in other things than just files. See IFileReadCallBack for more information about this.
Returns:
Returns a pointer to the created xml parser. This pointer should be deleted using 'delete' after no longer needed. Returns 0 if an error occured and the file could not be opened.

IrrXMLReaderUTF16* irr::io::createIrrXMLReaderUTF16 ( FILE * file )

Creates an instance of an UFT-16 xml parser.

This means that all character data will be returned in UTF-16. The file to read can be in any format, it will be converted to UTF-16 if it is not in this format. If you are using the Irrlicht Engine, it is better not to use this function but IFileSystem::createXMLReader() instead.

Parameters:
file,: Pointer to opened file, must have been opened in binary mode, e.g. using fopen("foo.bar", "wb"); The file will not be closed after it has been read.
Returns:
Returns a pointer to the created xml parser. This pointer should be deleted using 'delete' after no longer needed. Returns 0 if an error occured and the file could not be opened.

IrrXMLReaderUTF16* irr::io::createIrrXMLReaderUTF16 ( const char * filename )

Creates an instance of an UFT-16 xml parser.

This means that all character data will be returned in UTF-16. The file to read can be in any format, it will be converted to UTF-16 if it is not in this format. If you are using the Irrlicht Engine, it is better not to use this function but IFileSystem::createXMLReader() instead.

Parameters:
filename,: Name of file to be opened.
Returns:
Returns a pointer to the created xml parser. This pointer should be deleted using 'delete' after no longer needed. Returns 0 if an error occured and the file could not be opened.

IrrXMLReaderUTF32* irr::io::createIrrXMLReaderUTF32 ( IFileReadCallBack * callback )

Creates an instance of an UFT-32 xml parser.

This means that all character data will be returned in UTF-32. The file to read can be in any format, it will be converted to UTF-32 if it is not in this format. If you are using the Irrlicht Engine, it is better not to use this function but IFileSystem::createXMLReader() instead.

Parameters:
callback,: Callback for file read abstraction. Implement your own callback to make the xml parser read in other things than just files. See IFileReadCallBack for more information about this.
Returns:
Returns a pointer to the created xml parser. This pointer should be deleted using 'delete' after no longer needed. Returns 0 if an error occured and the file could not be opened.

IrrXMLReaderUTF32* irr::io::createIrrXMLReaderUTF32 ( FILE * file )

Creates an instance of an UFT-32 xml parser.

This means that all character data will be returned in UTF-32. The file to read can be in any format, it will be converted to UTF-32 if it is not in this format. if you are using the Irrlicht Engine, it is better not to use this function but IFileSystem::createXMLReader() instead.

Parameters:
file,: Pointer to opened file, must have been opened in binary mode, e.g. using fopen("foo.bar", "wb"); The file will not be closed after it has been read.
Returns:
Returns a pointer to the created xml parser. This pointer should be deleted using 'delete' after no longer needed. Returns 0 if an error occured and the file could not be opened.

IrrXMLReaderUTF32* irr::io::createIrrXMLReaderUTF32 ( const char * filename )

Creates an instance of an UFT-32 xml parser.

This means that all character data will be returned in UTF-32. The file to read can be in any format, it will be converted to UTF-32 if it is not in this format. If you are using the Irrlicht Engine, it is better not to use this function but IFileSystem::createXMLReader() instead.

Parameters:
filename,: Name of file to be opened.
Returns:
Returns a pointer to the created xml parser. This pointer should be deleted using 'delete' after no longer needed. Returns 0 if an error occured and the file could not be opened.


irrXML: Class List

Here are the classes, structs, unions and interfaces with brief descriptions:
irr::io::IFileReadCallBack | Callback class for file read abstraction
irr::io::IIrrXMLReader< char_type, super_class > | Interface providing easy read access to a XML file
irr::io::IXMLBase | Empty class to be used as parent class for IrrXMLReader


irrXML: irr::io::IFileReadCallBack Class Reference

irr::io::IFileReadCallBack Class Reference

Callback class for file read abstraction. More...

#include <irrXML.h>

List of all members.

Public Member Functions

virtual int | getSize ()=0
Returns size of file in bytes.
virtual int | read (void *buffer, int sizeToRead)=0
Reads an amount of bytes from the file.
virtual | ~IFileReadCallBack ()
virtual destructor

Detailed Description

Callback class for file read abstraction.

With this, it is possible to make the xml parser read in other things than just files. The Irrlicht engine is using this for example to read xml from compressed .zip files. To make the parser read in any other data, derive a class from this interface, implement the two methods to read your data and give a pointer to an instance of your implementation when calling createIrrXMLReader(), createIrrXMLReaderUTF16() or createIrrXMLReaderUTF32()

Definition at line 212 of file irrXML.h.

Constructor & Destructor Documentation

virtual irr::io::IFileReadCallBack::~IFileReadCallBack ( ) [inline, virtual]

virtual destructor

Definition at line 217 of file irrXML.h.

Member Function Documentation

virtual int irr::io::IFileReadCallBack::getSize ( ) [pure virtual]

Returns size of file in bytes.

virtual int irr::io::IFileReadCallBack::read | ( | void * | buffer,
 |  | int | sizeToRead
 | ) | [pure virtual]

Reads an amount of bytes from the file.

Parameters:
buffer,: Pointer to buffer where to read bytes will be written to.
sizeToRead,: Amount of bytes to read from the file.
Returns:
Returns how much bytes were read.

The documentation for this class was generated from the following file:
  • irrXML.h


irrXML: irr::io::IIrrXMLReader< char_type, super_class > Class Template Reference

irr::io::IIrrXMLReader< char_type, super_class > Class Template Reference

Interface providing easy read access to a XML file. More...

#include <irrXML.h>

List of all members.

Public Member Functions

virtual | float (const char_type *name) const =0
Returns the value of an attribute as float.
virtual int | getAttributeCount () const =0
Returns attribute count of the current XML node.
virtual const char_type * | getAttributeName (int idx) const =0
Returns name of an attribute.
virtual const char_type * | getAttributeValue (const char_type *name) const =0
Returns the value of an attribute.
virtual const char_type * | getAttributeValue (int idx) const =0
Returns the value of an attribute.
virtual float | getAttributeValueAsFloat (int idx) const =0
Returns the value of an attribute as float.
virtual int | getAttributeValueAsInt (int idx) const =0
Returns the value of an attribute as integer.
virtual int | getAttributeValueAsInt (const char_type *name) const =0
Returns the value of an attribute as integer.
virtual const char_type * | getAttributeValueSafe (const char_type *name) const =0
Returns the value of an attribute in a safe way.
virtual const char_type * | getNodeData () const =0
Returns data of the current node.
virtual const char_type * | getNodeName () const =0
Returns the name of the current node.
virtual EXML_NODE | getNodeType () const =0
Returns the type of the current XML node.
virtual ETEXT_FORMAT | getParserFormat () const =0
Returns format of the strings returned by the parser.
virtual ETEXT_FORMAT | getSourceFormat () const =0
Returns format of the source xml file.
virtual bool | isEmptyElement () const =0
Returns if an element is an empty element, like <foo />.
virtual bool | read ()=0
Reads forward to the next xml node.
virtual | ~IIrrXMLReader ()
Destructor.

Detailed Description

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:

        #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 Example for a more detailed example.

Definition at line 273 of file irrXML.h.

Constructor & Destructor Documentation

template<class char_type, class super_class>
virtual irr::io::IIrrXMLReader< char_type, super_class >::~IIrrXMLReader ( ) [inline, virtual]

Destructor.

Definition at line 278 of file irrXML.h.

Member Function Documentation

template<class char_type, class super_class>
virtual irr::io::IIrrXMLReader< char_type, super_class >::float ( const char_type * name ) const [pure virtual]

Returns the value of an attribute as float.

Parameters:
name,: Name of the attribute.
Returns:
Value of the attribute as float, and 0 if an attribute with this name does not exist or the value could not be interpreted as float.

template<class char_type, class super_class>
virtual 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.

Returns:
Returns amount of attributes of this xml node.

template<class char_type, class super_class>
virtual const char_type* irr::io::IIrrXMLReader< char_type, super_class >::getAttributeName ( int idx ) const [pure virtual]

Returns name of an attribute.

Parameters:
idx,: Zero based index, should be something between 0 and getAttributeCount()-1.
Returns:
Name of the attribute, 0 if an attribute with this index does not exist.

template<class char_type, class super_class>
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.

Parameters:
name,: Name of the attribute.
Returns:
Value of the attribute, 0 if an attribute with this name does not exist.

template<class char_type, class super_class>
virtual const char_type* irr::io::IIrrXMLReader< char_type, super_class >::getAttributeValue ( int idx ) const [pure virtual]

Returns the value of an attribute.

Parameters:
idx,: Zero based index, should be something between 0 and getAttributeCount()-1.
Returns:
Value of the attribute, 0 if an attribute with this index does not exist.

template<class char_type, class super_class>
virtual float irr::io::IIrrXMLReader< char_type, super_class >::getAttributeValueAsFloat ( int idx ) const [pure virtual]

Returns the value of an attribute as float.

Parameters:
idx,: Zero based index, should be something between 0 and getAttributeCount()-1.
Returns:
Value of the attribute as float, and 0 if an attribute with this index does not exist or the value could not be interpreted as float.

template<class char_type, class super_class>
virtual int irr::io::IIrrXMLReader< char_type, super_class >::getAttributeValueAsInt ( int idx ) const [pure virtual]

Returns the value of an attribute as integer.

Parameters:
idx,: Zero based index, should be something between 0 and getAttributeCount()-1.
Returns:
Value of the attribute as integer, and 0 if an attribute with this index does not exist or the value could not be interpreted as integer.

template<class char_type, class super_class>
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.

Parameters:
name Name of the attribute.
Returns:
Value of the attribute as integer, and 0 if an attribute with this name does not exist or the value could not be interpreted as integer.

template<class char_type, class super_class>
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.

Parameters:
name,: Name of the attribute.
Returns:
Value of the attribute, and "" if an attribute with this name does not exist

template<class char_type, class super_class>
virtual const char_type* irr::io::IIrrXMLReader< char_type, super_class >::getNodeData ( ) const [pure virtual]

Returns data of the current node.

Only non null if the node has some data and it is of type EXN_TEXT or EXN_UNKNOWN.

template<class char_type, class super_class>
virtual const char_type* irr::io::IIrrXMLReader< char_type, super_class >::getNodeName ( ) const [pure virtual]

Returns the name of the current node.

Only non null, if the node type is EXN_ELEMENT.

Returns:
Name of the current node or 0 if the node has no name.

template<class char_type, class super_class>
virtual EXML_NODE irr::io::IIrrXMLReader< char_type, super_class >::getNodeType ( ) const [pure virtual]

Returns the type of the current XML node.

template<class char_type, class super_class>
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.

template<class char_type, class super_class>
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.

template<class char_type, class super_class>
virtual bool irr::io::IIrrXMLReader< char_type, super_class >::isEmptyElement ( ) const [pure virtual]

Returns if an element is an empty element, like <foo />.

template<class char_type, class super_class>
virtual bool irr::io::IIrrXMLReader< char_type, super_class >::read ( ) [pure virtual]

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:
  • irrXML.h


irrXML: irr::io::IXMLBase Class Reference

irr::io::IXMLBase Class Reference

Empty class to be used as parent class for IrrXMLReader. More...

#include <irrXML.h>

Detailed Description

Empty class to be used as parent class for IrrXMLReader.

If you need another class as base class for the xml reader, you can do this by creating the reader using for example new CXMLReaderImpl<char, YourBaseClass>(yourcallback); The Irrlicht Engine for example needs IUnknown as base class for every object to let it automaticly reference countend, hence it replaces IXMLBase with IUnknown. See irrXML.cpp on how this can be done in detail.

Definition at line 235 of file irrXML.h.

The documentation for this class was generated from the following file:
  • irrXML.h


irrXML: Class Members

Here is a list of all class members with links to the classes they belong to:

  • float() : irr::io::IIrrXMLReader< char_type, super_class >
  • getAttributeCount() : irr::io::IIrrXMLReader< char_type, super_class >
  • getAttributeName() : irr::io::IIrrXMLReader< char_type, super_class >
  • getAttributeValue() : irr::io::IIrrXMLReader< char_type, super_class >
  • getAttributeValueAsFloat() : irr::io::IIrrXMLReader< char_type, super_class >
  • getAttributeValueAsInt() : irr::io::IIrrXMLReader< char_type, super_class >
  • getAttributeValueSafe() : irr::io::IIrrXMLReader< char_type, super_class >
  • getNodeData() : irr::io::IIrrXMLReader< char_type, super_class >
  • getNodeName() : irr::io::IIrrXMLReader< char_type, super_class >
  • getNodeType() : irr::io::IIrrXMLReader< char_type, super_class >
  • getParserFormat() : irr::io::IIrrXMLReader< char_type, super_class >
  • getSize() : irr::io::IFileReadCallBack
  • getSourceFormat() : irr::io::IIrrXMLReader< char_type, super_class >
  • isEmptyElement() : irr::io::IIrrXMLReader< char_type, super_class >
  • read() : irr::io::IIrrXMLReader< char_type, super_class >, irr::io::IFileReadCallBack
  • ~IFileReadCallBack() : irr::io::IFileReadCallBack
  • ~IIrrXMLReader() : irr::io::IIrrXMLReader< char_type, super_class >


irrXML: Namespace Index

irrXML Namespace List

Here is a list of all namespaces with brief descriptions:
irr
irr::io


irrXML: irr Namespace Reference

irr Namespace Reference

Namespaces

namespace io


irrXML: irr::io Namespace Reference

irr::io Namespace Reference

Classes

class | IFileReadCallBack
Callback class for file read abstraction. More...
class | IIrrXMLReader
Interface providing easy read access to a XML file. More...
class | IXMLBase
Empty class to be used as parent class for IrrXMLReader. More...

Typedefs

typedef unsigned short | char16
defines the utf-16 type.
typedef unsigned long | char32
defines the utf-32 type.
typedef IIrrXMLReader< char,
IXMLBase > 		IrrXMLReader
A UTF-8 or ASCII character xml parser.
typedef IIrrXMLReader< char16,
IXMLBase > 		IrrXMLReaderUTF16
A UTF-16 xml parser.
typedef IIrrXMLReader< char32,
IXMLBase > 		IrrXMLReaderUTF32
A UTF-32 xml parser.

Enumerations

enum ETEXT_FORMAT {
ETF_ASCII, ETF_UTF8, ETF_UTF16_BE, ETF_UTF16_LE,
ETF_UTF32_BE, ETF_UTF32_LE
}
Enumeration of all supported source text file formats. More...
enum EXML_NODE {
EXN_NONE, EXN_ELEMENT, EXN_ELEMENT_END, EXN_TEXT,
EXN_COMMENT, EXN_CDATA, EXN_UNKNOWN
}
Enumeration for all xml nodes which are parsed by IrrXMLReader. More...

Functions

IrrXMLReader * | createIrrXMLReader (IFileReadCallBack *callback)
Creates an instance of an UFT-8 or ASCII character xml parser.
IrrXMLReader * | createIrrXMLReader (FILE *file)
Creates an instance of an UFT-8 or ASCII character xml parser.
IrrXMLReader * | createIrrXMLReader (const char *filename)
Creates an instance of an UFT-8 or ASCII character xml parser.
IrrXMLReaderUTF16 * | createIrrXMLReaderUTF16 (IFileReadCallBack *callback)
Creates an instance of an UFT-16 xml parser.
IrrXMLReaderUTF16 * | createIrrXMLReaderUTF16 (FILE *file)
Creates an instance of an UFT-16 xml parser.
IrrXMLReaderUTF16 * | createIrrXMLReaderUTF16 (const char *filename)
Creates an instance of an UFT-16 xml parser.
IrrXMLReaderUTF32 * | createIrrXMLReaderUTF32 (IFileReadCallBack *callback)
Creates an instance of an UFT-32 xml parser.
IrrXMLReaderUTF32 * | createIrrXMLReaderUTF32 (FILE *file)
Creates an instance of an UFT-32 xml parser.
IrrXMLReaderUTF32 * | createIrrXMLReaderUTF32 (const char *filename)
Creates an instance of an UFT-32 xml parser.

Typedef Documentation

typedef unsigned short irr::io::char16

defines the utf-16 type.

Not using wchar_t for this because wchar_t has 16 bit on windows and 32 bit on other operating systems.

Definition at line 371 of file irrXML.h.

typedef unsigned long irr::io::char32

defines the utf-32 type.

Not using wchar_t for this because wchar_t has 16 bit on windows and 32 bit on other operating systems.

Definition at line 376 of file irrXML.h.

typedef IIrrXMLReader<char, IXMLBase> irr::io::IrrXMLReader

A UTF-8 or ASCII character xml parser.

This means that all character data will be returned in 8 bit ASCII or UTF-8 by this parser. The file to read can be in any format, it will be converted to UTF-8 if it is not in this format. Create an instance of this with createIrrXMLReader(); See IIrrXMLReader for description on how to use it.

Definition at line 384 of file irrXML.h.

typedef IIrrXMLReader<char16, IXMLBase> irr::io::IrrXMLReaderUTF16

A UTF-16 xml parser.

This means that all character data will be returned in UTF-16 by this parser. The file to read can be in any format, it will be converted to UTF-16 if it is not in this format. Create an instance of this with createIrrXMLReaderUTF16(); See IIrrXMLReader for description on how to use it.

Definition at line 392 of file irrXML.h.

typedef IIrrXMLReader<char32, IXMLBase> irr::io::IrrXMLReaderUTF32

A UTF-32 xml parser.

This means that all character data will be returned in UTF-32 by this parser. The file to read can be in any format, it will be converted to UTF-32 if it is not in this format. Create an instance of this with createIrrXMLReaderUTF32(); See IIrrXMLReader for description on how to use it.

Definition at line 400 of file irrXML.h.

Enumeration Type Documentation

enum irr::io::ETEXT_FORMAT

Enumeration of all supported source text file formats.

Enumeration values:
ETF_ASCII | ASCII, file without byte order mark, or not a text file.
ETF_UTF8 | UTF-8 format.
ETF_UTF16_BE | UTF-16 format, big endian.
ETF_UTF16_LE | UTF-16 format, little endian.
ETF_UTF32_BE | UTF-32 format, big endian.
ETF_UTF32_LE | UTF-32 format, little endian.

Definition at line 157 of file irrXML.h.

enum irr::io::EXML_NODE

Enumeration for all xml nodes which are parsed by IrrXMLReader.

Enumeration values:
EXN_NONE | No xml node. This is usually the node if you did not read anything yet.
EXN_ELEMENT | A xml element, like <foo>.
EXN_ELEMENT_END | End of an xml element, like </foo>.
EXN_TEXT | Text within a xml element: <foo> this is the text. </foo>.
EXN_COMMENT | An xml comment like <!-- I am a comment --> or a DTD definition.
EXN_CDATA | An xml cdata section like <![CDATA[ this is some CDATA ]]>.
EXN_UNKNOWN | Unknown element.

Definition at line 180 of file irrXML.h.

Function Documentation

IrrXMLReader* irr::io::createIrrXMLReader ( IFileReadCallBack * callback )

Creates an instance of an UFT-8 or ASCII character xml parser.

This means that all character data will be returned in 8 bit ASCII or UTF-8. The file to read can be in any format, it will be converted to UTF-8 if it is not in this format. If you are using the Irrlicht Engine, it is better not to use this function but IFileSystem::createXMLReaderUTF8() instead.

Parameters:
callback,: Callback for file read abstraction. Implement your own callback to make the xml parser read in other things than just files. See IFileReadCallBack for more information about this.
Returns:
Returns a pointer to the created xml parser. This pointer should be deleted using 'delete' after no longer needed. Returns 0 if an error occured and the file could not be opened.

IrrXMLReader* irr::io::createIrrXMLReader ( FILE * file )

Creates an instance of an UFT-8 or ASCII character xml parser.

This means that all character data will be returned in 8 bit ASCII or UTF-8. The file to read can be in any format, it will be converted to UTF-8 if it is not in this format. If you are using the Irrlicht Engine, it is better not to use this function but IFileSystem::createXMLReaderUTF8() instead.

Parameters:
file,: Pointer to opened file, must have been opened in binary mode, e.g. using fopen("foo.bar", "wb"); The file will not be closed after it has been read.
Returns:
Returns a pointer to the created xml parser. This pointer should be deleted using 'delete' after no longer needed. Returns 0 if an error occured and the file could not be opened.

IrrXMLReader* irr::io::createIrrXMLReader ( const char * filename )

Creates an instance of an UFT-8 or ASCII character xml parser.

This means that all character data will be returned in 8 bit ASCII or UTF-8. The file to read can be in any format, it will be converted to UTF-8 if it is not in this format. If you are using the Irrlicht Engine, it is better not to use this function but IFileSystem::createXMLReaderUTF8() instead.

Parameters:
filename,: Name of file to be opened.
Returns:
Returns a pointer to the created xml parser. This pointer should be deleted using 'delete' after no longer needed. Returns 0 if an error occured and the file could not be opened.

IrrXMLReaderUTF16* irr::io::createIrrXMLReaderUTF16 ( IFileReadCallBack * callback )

Creates an instance of an UFT-16 xml parser.

This means that all character data will be returned in UTF-16. The file to read can be in any format, it will be converted to UTF-16 if it is not in this format. If you are using the Irrlicht Engine, it is better not to use this function but IFileSystem::createXMLReader() instead.

Parameters:
callback,: Callback for file read abstraction. Implement your own callback to make the xml parser read in other things than just files. See IFileReadCallBack for more information about this.
Returns:
Returns a pointer to the created xml parser. This pointer should be deleted using 'delete' after no longer needed. Returns 0 if an error occured and the file could not be opened.

IrrXMLReaderUTF16* irr::io::createIrrXMLReaderUTF16 ( FILE * file )

Creates an instance of an UFT-16 xml parser.

This means that all character data will be returned in UTF-16. The file to read can be in any format, it will be converted to UTF-16 if it is not in this format. If you are using the Irrlicht Engine, it is better not to use this function but IFileSystem::createXMLReader() instead.

Parameters:
file,: Pointer to opened file, must have been opened in binary mode, e.g. using fopen("foo.bar", "wb"); The file will not be closed after it has been read.
Returns:
Returns a pointer to the created xml parser. This pointer should be deleted using 'delete' after no longer needed. Returns 0 if an error occured and the file could not be opened.

IrrXMLReaderUTF16* irr::io::createIrrXMLReaderUTF16 ( const char * filename )

Creates an instance of an UFT-16 xml parser.

This means that all character data will be returned in UTF-16. The file to read can be in any format, it will be converted to UTF-16 if it is not in this format. If you are using the Irrlicht Engine, it is better not to use this function but IFileSystem::createXMLReader() instead.

Parameters:
filename,: Name of file to be opened.
Returns:
Returns a pointer to the created xml parser. This pointer should be deleted using 'delete' after no longer needed. Returns 0 if an error occured and the file could not be opened.

IrrXMLReaderUTF32* irr::io::createIrrXMLReaderUTF32 ( IFileReadCallBack * callback )

Creates an instance of an UFT-32 xml parser.

This means that all character data will be returned in UTF-32. The file to read can be in any format, it will be converted to UTF-32 if it is not in this format. If you are using the Irrlicht Engine, it is better not to use this function but IFileSystem::createXMLReader() instead.

Parameters:
callback,: Callback for file read abstraction. Implement your own callback to make the xml parser read in other things than just files. See IFileReadCallBack for more information about this.
Returns:
Returns a pointer to the created xml parser. This pointer should be deleted using 'delete' after no longer needed. Returns 0 if an error occured and the file could not be opened.

IrrXMLReaderUTF32* irr::io::createIrrXMLReaderUTF32 ( FILE * file )

Creates an instance of an UFT-32 xml parser.

This means that all character data will be returned in UTF-32. The file to read can be in any format, it will be converted to UTF-32 if it is not in this format. if you are using the Irrlicht Engine, it is better not to use this function but IFileSystem::createXMLReader() instead.

Parameters:
file,: Pointer to opened file, must have been opened in binary mode, e.g. using fopen("foo.bar", "wb"); The file will not be closed after it has been read.
Returns:
Returns a pointer to the created xml parser. This pointer should be deleted using 'delete' after no longer needed. Returns 0 if an error occured and the file could not be opened.

IrrXMLReaderUTF32* irr::io::createIrrXMLReaderUTF32 ( const char * filename )

Creates an instance of an UFT-32 xml parser.

This means that all character data will be returned in UTF-32. The file to read can be in any format, it will be converted to UTF-32 if it is not in this format. If you are using the Irrlicht Engine, it is better not to use this function but IFileSystem::createXMLReader() instead.

Parameters:
filename,: Name of file to be opened.
Returns:
Returns a pointer to the created xml parser. This pointer should be deleted using 'delete' after no longer needed. Returns 0 if an error occured and the file could not be opened.


irrXML: Class Members

Here is a list of all file members with links to the files they belong to:

  • char16 : irrXML.h
  • char32 : irrXML.h
  • createIrrXMLReader() : irrXML.h
  • createIrrXMLReaderUTF16() : irrXML.h
  • createIrrXMLReaderUTF32() : irrXML.h
  • ETEXT_FORMAT : irrXML.h
  • ETF_ASCII : irrXML.h
  • ETF_UTF16_BE : irrXML.h
  • ETF_UTF16_LE : irrXML.h
  • ETF_UTF32_BE : irrXML.h
  • ETF_UTF32_LE : irrXML.h
  • ETF_UTF8 : irrXML.h
  • EXML_NODE : irrXML.h
  • EXN_CDATA : irrXML.h
  • EXN_COMMENT : irrXML.h
  • EXN_ELEMENT : irrXML.h
  • EXN_ELEMENT_END : irrXML.h
  • EXN_NONE : irrXML.h
  • EXN_TEXT : irrXML.h
  • EXN_UNKNOWN : irrXML.h
  • IrrXMLReader : irrXML.h
  • IrrXMLReaderUTF16 : irrXML.h
  • IrrXMLReaderUTF32 : irrXML.h


irrXML: Class Members

Here is a list of all namespace members with links to the namespace documentation for each member:

  • char16 : irr::io
  • char32 : irr::io
  • createIrrXMLReader() : irr::io
  • createIrrXMLReaderUTF16() : irr::io
  • createIrrXMLReaderUTF32() : irr::io
  • ETEXT_FORMAT : irr::io
  • ETF_ASCII : irr::io
  • ETF_UTF16_BE : irr::io
  • ETF_UTF16_LE : irr::io
  • ETF_UTF32_BE : irr::io
  • ETF_UTF32_LE : irr::io
  • ETF_UTF8 : irr::io
  • EXML_NODE : irr::io
  • EXN_CDATA : irr::io
  • EXN_COMMENT : irr::io
  • EXN_ELEMENT : irr::io
  • EXN_ELEMENT_END : irr::io
  • EXN_NONE : irr::io
  • EXN_TEXT : irr::io
  • EXN_UNKNOWN : irr::io
  • IrrXMLReader : irr::io
  • IrrXMLReaderUTF16 : irr::io
  • IrrXMLReaderUTF32 : irr::io


irrXML: Alphabetical List

irrXML Class Index

I

I
IFileReadCallBack (irr::io) IIrrXMLReader (irr::io) IXMLBase (irr::io)

I


irrXML: Member List

irr::io::IFileReadCallBack Member List

This is the complete list of members for irr::io::IFileReadCallBack, including all inherited members.

getSize()=0 | irr::io::IFileReadCallBack | [pure virtual]
read(void *buffer, int sizeToRead)=0 | irr::io::IFileReadCallBack | [pure virtual]
~IFileReadCallBack() | irr::io::IFileReadCallBack | [inline, virtual]


irrXML: Member List

irr::io::IIrrXMLReader< char_type, super_class > Member List

This is the complete list of members for irr::io::IIrrXMLReader< char_type, super_class >, including all inherited members.

float(const char_type *name) const =0 | irr::io::IIrrXMLReader< char_type, super_class > | [pure virtual]
getAttributeCount() const =0 | irr::io::IIrrXMLReader< char_type, super_class > | [pure virtual]
getAttributeName(int idx) const =0 | irr::io::IIrrXMLReader< char_type, super_class > | [pure virtual]
getAttributeValue(int idx) const =0 | irr::io::IIrrXMLReader< char_type, super_class > | [pure virtual]
getAttributeValue(const char_type *name) const =0 | irr::io::IIrrXMLReader< char_type, super_class > | [pure virtual]
getAttributeValueAsFloat(int idx) const =0 | irr::io::IIrrXMLReader< char_type, super_class > | [pure virtual]
getAttributeValueAsInt(const char_type *name) const =0 | irr::io::IIrrXMLReader< char_type, super_class > | [pure virtual]
getAttributeValueAsInt(int idx) const =0 | irr::io::IIrrXMLReader< char_type, super_class > | [pure virtual]
getAttributeValueSafe(const char_type *name) const =0 | irr::io::IIrrXMLReader< char_type, super_class > | [pure virtual]
getNodeData() const =0 | irr::io::IIrrXMLReader< char_type, super_class > | [pure virtual]
getNodeName() const =0 | irr::io::IIrrXMLReader< char_type, super_class > | [pure virtual]
getNodeType() const =0 | irr::io::IIrrXMLReader< char_type, super_class > | [pure virtual]
getParserFormat() const =0 | irr::io::IIrrXMLReader< char_type, super_class > | [pure virtual]
getSourceFormat() const =0 | irr::io::IIrrXMLReader< char_type, super_class > | [pure virtual]
isEmptyElement() const =0 | irr::io::IIrrXMLReader< char_type, super_class > | [pure virtual]
read()=0 | irr::io::IIrrXMLReader< char_type, super_class > | [pure virtual]
~IIrrXMLReader() | irr::io::IIrrXMLReader< char_type, super_class > | [inline, virtual]


irrXML: Class Members - Functions

  • float() : irr::io::IIrrXMLReader< char_type, super_class >
  • getAttributeCount() : irr::io::IIrrXMLReader< char_type, super_class >
  • getAttributeName() : irr::io::IIrrXMLReader< char_type, super_class >
  • getAttributeValue() : irr::io::IIrrXMLReader< char_type, super_class >
  • getAttributeValueAsFloat() : irr::io::IIrrXMLReader< char_type, super_class >
  • getAttributeValueAsInt() : irr::io::IIrrXMLReader< char_type, super_class >
  • getAttributeValueSafe() : irr::io::IIrrXMLReader< char_type, super_class >
  • getNodeData() : irr::io::IIrrXMLReader< char_type, super_class >
  • getNodeName() : irr::io::IIrrXMLReader< char_type, super_class >
  • getNodeType() : irr::io::IIrrXMLReader< char_type, super_class >
  • getParserFormat() : irr::io::IIrrXMLReader< char_type, super_class >
  • getSize() : irr::io::IFileReadCallBack
  • getSourceFormat() : irr::io::IIrrXMLReader< char_type, super_class >
  • isEmptyElement() : irr::io::IIrrXMLReader< char_type, super_class >
  • read() : irr::io::IIrrXMLReader< char_type, super_class >, irr::io::IFileReadCallBack
  • ~IFileReadCallBack() : irr::io::IFileReadCallBack
  • ~IIrrXMLReader() : irr::io::IIrrXMLReader< char_type, super_class >


irrXML: Class Members

  • ETEXT_FORMAT : irrXML.h
  • EXML_NODE : irrXML.h


irrXML: Class Members

  • ETF_ASCII : irrXML.h
  • ETF_UTF16_BE : irrXML.h
  • ETF_UTF16_LE : irrXML.h
  • ETF_UTF32_BE : irrXML.h
  • ETF_UTF32_LE : irrXML.h
  • ETF_UTF8 : irrXML.h
  • EXN_CDATA : irrXML.h
  • EXN_COMMENT : irrXML.h
  • EXN_ELEMENT : irrXML.h
  • EXN_ELEMENT_END : irrXML.h
  • EXN_NONE : irrXML.h
  • EXN_TEXT : irrXML.h
  • EXN_UNKNOWN : irrXML.h


irrXML: Class Members

  • createIrrXMLReader() : irrXML.h
  • createIrrXMLReaderUTF16() : irrXML.h
  • createIrrXMLReaderUTF32() : irrXML.h


irrXML: Class Members

  • char16 : irrXML.h
  • char32 : irrXML.h
  • IrrXMLReader : irrXML.h
  • IrrXMLReaderUTF16 : irrXML.h
  • IrrXMLReaderUTF32 : irrXML.h


irrXML: irrXML.h Source File

irrXML.h

Go to the documentation of this file.
00001 // Copyright (C) 2002-2005 Nikolaus Gebhardt
00002 // This file is part of the "Irrlicht Engine" and the "irrXML" project.
00003 // For conditions of distribution and use, see copyright notice in irrlicht.h and/or irrXML.h
00004
00005 #ifndef __IRR_XML_H_INCLUDED__
00006 #define __IRR_XML_H_INCLUDED__
00007
00008 #include <stdio.h>
00009
00152 namespace irr
00153 {
00154 namespace io
00155 {
00157         enum ETEXT_FORMAT
00158         {
00160                 ETF_ASCII,
00161
00163                 ETF_UTF8,
00164
00166                 ETF_UTF16_BE,
00167
00169                 ETF_UTF16_LE,
00170
00172                 ETF_UTF32_BE,
00173
00175                 ETF_UTF32_LE,
00176         };
00177
00178
00180         enum EXML_NODE
00181         {
00183                 EXN_NONE,
00184
00186                 EXN_ELEMENT,
00187
00189                 EXN_ELEMENT_END,
00190
00192                 EXN_TEXT,
00193
00195                 EXN_COMMENT,
00196
00198                 EXN_CDATA,
00199
00201                 EXN_UNKNOWN
00202         };
00203
00205
00212         class IFileReadCallBack
00213         {
00214         public:
00215
00217                 virtual ~IFileReadCallBack() {};
00218
00220
00223                 virtual int read(void* buffer, int sizeToRead) = 0;
00224
00226                 virtual int getSize() = 0;
00227         };
00228
00230
00235         class IXMLBase
00236         {
00237         };
00238
00240
00272         template<class char_type, class super_class>
00273         class IIrrXMLReader : public super_class
00274         {
00275         public:
00276
00278                 virtual ~IIrrXMLReader() {};
00279
00281
00282                 virtual bool read() = 0;
00283
00285                 virtual EXML_NODE getNodeType() const = 0;
00286
00288
00291                 virtual int getAttributeCount() const = 0;
00292
00294
00296                 virtual const char_type* getAttributeName(int idx) const = 0;
00297
00299
00301                 virtual const char_type* getAttributeValue(int idx) const = 0;
00302
00304
00306                 virtual const char_type* getAttributeValue(const char_type* name) const = 0;
00307
00309
00313                 virtual const char_type* getAttributeValueSafe(const char_type* name) const = 0;
00314
00316
00319                 virtual int getAttributeValueAsInt(const char_type* name) const = 0;
00320
00322
00325                 virtual int getAttributeValueAsInt(int idx) const = 0;
00326
00328
00331                 virtual float   (const char_type* name) const = 0;
00332
00334
00337                 virtual float getAttributeValueAsFloat(int idx) const = 0;
00338
00340
00342                 virtual const char_type* getNodeName() const = 0;
00343
00345
00347                 virtual const char_type* getNodeData() const = 0;
00348
00350                 virtual bool isEmptyElement() const = 0;
00351
00353
00357                 virtual ETEXT_FORMAT getSourceFormat() const = 0;
00358
00360
00364                 virtual ETEXT_FORMAT getParserFormat() const = 0;
00365         };
00366
00367
00369
00371         typedef unsigned short char16;
00372
00374
00376         typedef unsigned long char32;
00377
00379
00384         typedef IIrrXMLReader<char, IXMLBase> IrrXMLReader;
00385
00387
00392         typedef IIrrXMLReader<char16, IXMLBase> IrrXMLReaderUTF16;
00393
00395
00400         typedef IIrrXMLReader<char32, IXMLBase> IrrXMLReaderUTF32;
00401
00402
00404
00412         IrrXMLReader* createIrrXMLReader(const char* filename);
00413
00415
00424         IrrXMLReader* createIrrXMLReader(FILE* file);
00425
00427
00437         IrrXMLReader* createIrrXMLReader(IFileReadCallBack* callback);
00438
00440
00449         IrrXMLReaderUTF16* createIrrXMLReaderUTF16(const char* filename);
00450
00452
00461         IrrXMLReaderUTF16* createIrrXMLReaderUTF16(FILE* file);
00462
00464
00474         IrrXMLReaderUTF16* createIrrXMLReaderUTF16(IFileReadCallBack* callback);
00475
00476
00478
00486         IrrXMLReaderUTF32* createIrrXMLReaderUTF32(const char* filename);
00487
00489
00498         IrrXMLReaderUTF32* createIrrXMLReaderUTF32(FILE* file);
00499
00501
00512         IrrXMLReaderUTF32* createIrrXMLReaderUTF32(IFileReadCallBack* callback);
00513
00514
00536 } // end namespace io
00537 } // end namespace irr
00538
00539 #endif // __IRR_XML_H_INCLUDED__
00540


irrXML: Class Members

  • ETEXT_FORMAT : irr::io
  • EXML_NODE : irr::io


irrXML: Class Members

  • ETF_ASCII : irr::io
  • ETF_UTF16_BE : irr::io
  • ETF_UTF16_LE : irr::io
  • ETF_UTF32_BE : irr::io
  • ETF_UTF32_LE : irr::io
  • ETF_UTF8 : irr::io
  • EXN_CDATA : irr::io
  • EXN_COMMENT : irr::io
  • EXN_ELEMENT : irr::io
  • EXN_ELEMENT_END : irr::io
  • EXN_NONE : irr::io
  • EXN_TEXT : irr::io
  • EXN_UNKNOWN : irr::io


irrXML: Class Members

  • createIrrXMLReader() : irr::io
  • createIrrXMLReaderUTF16() : irr::io
  • createIrrXMLReaderUTF32() : irr::io


irrXML: Class Members

  • char16 : irr::io
  • char32 : irr::io
  • IrrXMLReader : irr::io
  • IrrXMLReaderUTF16 : irr::io
  • IrrXMLReaderUTF32 : irr::io