nuclear@0: // Copyright (C) 2002-2005 Nikolaus Gebhardt nuclear@0: // This file is part of the "Irrlicht Engine" and the "irrXML" project. nuclear@0: // For conditions of distribution and use, see copyright notice in irrlicht.h and/or irrXML.h nuclear@0: nuclear@0: #ifndef __IRR_XML_H_INCLUDED__ nuclear@0: #define __IRR_XML_H_INCLUDED__ nuclear@0: nuclear@0: #include nuclear@0: nuclear@0: /** \mainpage irrXML 1.2 API documentation nuclear@0:
nuclear@0: nuclear@0: \section intro Introduction nuclear@0: nuclear@0: Welcome to the irrXML API documentation. nuclear@0: Here you'll find any information you'll need to develop applications with nuclear@0: irrXML. If you look for a tutorial on how to start, take a look at the \ref irrxmlexample, nuclear@0: at the homepage of irrXML at xml.irrlicht3d.org nuclear@0: or into the SDK in the directory \example. nuclear@0: nuclear@0: irrXML is intended to be a high speed and easy-to-use XML Parser for C++, and nuclear@0: this documentation is an important part of it. If you have any questions or nuclear@0: suggestions, just send a email to the author of the engine, Nikolaus Gebhardt nuclear@0: (niko (at) irrlicht3d.org). For more informations about this parser, see \ref history. nuclear@0: nuclear@0: \section features Features nuclear@0: nuclear@0: irrXML provides forward-only, read-only nuclear@0: access to a stream of non validated XML data. It was fully implemented by nuclear@0: Nikolaus Gebhardt. Its current features are: nuclear@0: nuclear@0: - It it fast as lighting and has very low memory usage. It was nuclear@0: developed with the intention of being used in 3D games, as it already has been. nuclear@0: - irrXML is very small: It only consists of 60 KB of code and can be added easily nuclear@0: to your existing project. nuclear@0: - Of course, it is platform independent and works with lots of compilers. nuclear@0: - It is able to parse ASCII, UTF-8, UTF-16 and UTF-32 text files, both in nuclear@0: little and big endian format. nuclear@0: - Independent of the input file format, the parser can return all strings in ASCII, UTF-8, nuclear@0: UTF-16 and UTF-32 format. nuclear@0: - With its optional file access abstraction it has the advantage that it can read not nuclear@0: only from files but from any type of data (memory, network, ...). For example when nuclear@0: used with the Irrlicht Engine, it directly reads from compressed .zip files. nuclear@0: - Just like the Irrlicht Engine for which it was originally created, it is extremely easy nuclear@0: to use. nuclear@0: - It has no external dependencies, it does not even need the STL. nuclear@0: nuclear@0: Although irrXML has some strenghts, it currently also has the following limitations: nuclear@0: nuclear@0: - The input xml file is not validated and assumed to be correct. nuclear@0: nuclear@0: \section irrxmlexample Example nuclear@0: nuclear@0: The following code demonstrates the basic usage of irrXML. A simple xml nuclear@0: file like this is parsed: nuclear@0: \code nuclear@0: nuclear@0: nuclear@0: nuclear@0: nuclear@0: nuclear@0: Welcome to the Mesh Viewer of the "Irrlicht Engine". nuclear@0: nuclear@0: nuclear@0: \endcode nuclear@0: nuclear@0: The code for parsing this file would look like this: nuclear@0: \code nuclear@0: #include nuclear@0: using namespace irr; // irrXML is located in the namespace irr::io nuclear@0: using namespace io; nuclear@0: nuclear@0: #include // we use STL strings to store data in this example nuclear@0: nuclear@0: void main() nuclear@0: { nuclear@0: // create the reader using one of the factory functions nuclear@0: nuclear@0: IrrXMLReader* xml = createIrrXMLReader("config.xml"); nuclear@0: nuclear@0: // strings for storing the data we want to get out of the file nuclear@0: std::string modelFile; nuclear@0: std::string messageText; nuclear@0: std::string caption; nuclear@0: nuclear@0: // parse the file until end reached nuclear@0: nuclear@0: while(xml && xml->read()) nuclear@0: { nuclear@0: switch(xml->getNodeType()) nuclear@0: { nuclear@0: case EXN_TEXT: nuclear@0: // in this xml file, the only text which occurs is the messageText nuclear@0: messageText = xml->getNodeData(); nuclear@0: break; nuclear@0: case EXN_ELEMENT: nuclear@0: { nuclear@0: if (!strcmp("model", xml->getNodeName())) nuclear@0: modelFile = xml->getAttributeValue("file"); nuclear@0: else nuclear@0: if (!strcmp("messageText", xml->getNodeName())) nuclear@0: caption = xml->getAttributeValue("caption"); nuclear@0: } nuclear@0: break; nuclear@0: } nuclear@0: } nuclear@0: nuclear@0: // delete the xml parser after usage nuclear@0: delete xml; nuclear@0: } nuclear@0: \endcode nuclear@0: nuclear@0: \section howto How to use nuclear@0: nuclear@0: Simply add the source files in the /src directory of irrXML to your project. Done. nuclear@0: nuclear@0: \section license License nuclear@0: nuclear@0: The irrXML license is based on the zlib license. Basicly, this means you can do with nuclear@0: irrXML whatever you want: nuclear@0: nuclear@0: Copyright (C) 2002-2005 Nikolaus Gebhardt nuclear@0: nuclear@0: This software is provided 'as-is', without any express or implied nuclear@0: warranty. In no event will the authors be held liable for any damages nuclear@0: arising from the use of this software. nuclear@0: nuclear@0: Permission is granted to anyone to use this software for any purpose, nuclear@0: including commercial applications, and to alter it and redistribute it nuclear@0: freely, subject to the following restrictions: nuclear@0: nuclear@0: 1. The origin of this software must not be misrepresented; you must not nuclear@0: claim that you wrote the original software. If you use this software nuclear@0: in a product, an acknowledgment in the product documentation would be nuclear@0: appreciated but is not required. nuclear@0: nuclear@0: 2. Altered source versions must be plainly marked as such, and must not be nuclear@0: misrepresented as being the original software. nuclear@0: nuclear@0: 3. This notice may not be removed or altered from any source distribution. nuclear@0: nuclear@0: \section history History nuclear@0: nuclear@0: As lots of references in this documentation and the source show, this xml nuclear@0: parser has originally been a part of the nuclear@0: Irrlicht Engine. But because nuclear@0: the parser has become very useful with the latest release, people asked for a nuclear@0: separate version of it, to be able to use it in non Irrlicht projects. With nuclear@0: irrXML 1.0, this has now been done. nuclear@0: */ nuclear@0: nuclear@0: namespace irr nuclear@0: { nuclear@0: namespace io nuclear@0: { nuclear@0: //! Enumeration of all supported source text file formats nuclear@0: enum ETEXT_FORMAT nuclear@0: { nuclear@0: //! ASCII, file without byte order mark, or not a text file nuclear@0: ETF_ASCII, nuclear@0: nuclear@0: //! UTF-8 format nuclear@0: ETF_UTF8, nuclear@0: nuclear@0: //! UTF-16 format, big endian nuclear@0: ETF_UTF16_BE, nuclear@0: nuclear@0: //! UTF-16 format, little endian nuclear@0: ETF_UTF16_LE, nuclear@0: nuclear@0: //! UTF-32 format, big endian nuclear@0: ETF_UTF32_BE, nuclear@0: nuclear@0: //! UTF-32 format, little endian nuclear@0: ETF_UTF32_LE nuclear@0: }; nuclear@0: nuclear@0: nuclear@0: //! Enumeration for all xml nodes which are parsed by IrrXMLReader nuclear@0: enum EXML_NODE nuclear@0: { nuclear@0: //! No xml node. This is usually the node if you did not read anything yet. nuclear@0: EXN_NONE, nuclear@0: nuclear@0: //! A xml element, like nuclear@0: EXN_ELEMENT, nuclear@0: nuclear@0: //! End of an xml element, like nuclear@0: EXN_ELEMENT_END, nuclear@0: nuclear@0: //! Text within a xml element: this is the text. nuclear@0: EXN_TEXT, nuclear@0: nuclear@0: //! An xml comment like <!-- I am a comment --> or a DTD definition. nuclear@0: EXN_COMMENT, nuclear@0: nuclear@0: //! An xml cdata section like <![CDATA[ this is some CDATA ]]> nuclear@0: EXN_CDATA, nuclear@0: nuclear@0: //! Unknown element. nuclear@0: EXN_UNKNOWN nuclear@0: }; nuclear@0: nuclear@0: //! Callback class for file read abstraction. nuclear@0: /** With this, it is possible to make the xml parser read in other things nuclear@0: than just files. The Irrlicht engine is using this for example to nuclear@0: read xml from compressed .zip files. To make the parser read in nuclear@0: any other data, derive a class from this interface, implement the nuclear@0: two methods to read your data and give a pointer to an instance of nuclear@0: your implementation when calling createIrrXMLReader(), nuclear@0: createIrrXMLReaderUTF16() or createIrrXMLReaderUTF32() */ nuclear@0: class IFileReadCallBack nuclear@0: { nuclear@0: public: nuclear@0: nuclear@0: //! virtual destructor nuclear@0: virtual ~IFileReadCallBack() {}; nuclear@0: nuclear@0: //! Reads an amount of bytes from the file. nuclear@0: /** \param buffer: Pointer to buffer where to read bytes will be written to. nuclear@0: \param sizeToRead: Amount of bytes to read from the file. nuclear@0: \return Returns how much bytes were read. */ nuclear@0: virtual int read(void* buffer, int sizeToRead) = 0; nuclear@0: nuclear@0: //! Returns size of file in bytes nuclear@0: virtual int getSize() = 0; nuclear@0: }; nuclear@0: nuclear@0: //! Empty class to be used as parent class for IrrXMLReader. nuclear@0: /** If you need another class as base class for the xml reader, you can do this by creating nuclear@0: the reader using for example new CXMLReaderImpl(yourcallback); nuclear@0: The Irrlicht Engine for example needs IUnknown as base class for every object to nuclear@0: let it automaticly reference countend, hence it replaces IXMLBase with IUnknown. nuclear@0: See irrXML.cpp on how this can be done in detail. */ nuclear@0: class IXMLBase nuclear@0: { nuclear@0: }; nuclear@0: nuclear@0: //! Interface providing easy read access to a XML file. nuclear@0: /** You can create an instance of this reader using one of the factory functions nuclear@0: createIrrXMLReader(), createIrrXMLReaderUTF16() and createIrrXMLReaderUTF32(). nuclear@0: If using the parser from the Irrlicht Engine, please use IFileSystem::createXMLReader() nuclear@0: instead. nuclear@0: For a detailed intro how to use the parser, see \ref irrxmlexample and \ref features. nuclear@0: nuclear@0: The typical usage of this parser looks like this: nuclear@0: \code nuclear@0: #include nuclear@0: using namespace irr; // irrXML is located in the namespace irr::io nuclear@0: using namespace io; nuclear@0: nuclear@0: void main() nuclear@0: { nuclear@0: // create the reader using one of the factory functions nuclear@0: IrrXMLReader* xml = createIrrXMLReader("config.xml"); nuclear@0: nuclear@0: if (xml == 0) nuclear@0: return; // file could not be opened nuclear@0: nuclear@0: // parse the file until end reached nuclear@0: while(xml->read()) nuclear@0: { nuclear@0: // based on xml->getNodeType(), do something. nuclear@0: } nuclear@0: nuclear@0: // delete the xml parser after usage nuclear@0: delete xml; nuclear@0: } nuclear@0: \endcode nuclear@0: See \ref irrxmlexample for a more detailed example. nuclear@0: */ nuclear@0: template nuclear@0: class IIrrXMLReader : public super_class nuclear@0: { nuclear@0: public: nuclear@0: nuclear@0: //! Destructor nuclear@0: virtual ~IIrrXMLReader() {}; nuclear@0: nuclear@0: //! Reads forward to the next xml node. nuclear@0: /** \return Returns false, if there was no further node. */ nuclear@0: virtual bool read() = 0; nuclear@0: nuclear@0: //! Returns the type of the current XML node. nuclear@0: virtual EXML_NODE getNodeType() const = 0; nuclear@0: nuclear@0: //! Returns attribute count of the current XML node. nuclear@0: /** This is usually nuclear@0: non null if the current node is EXN_ELEMENT, and the element has attributes. nuclear@0: \return Returns amount of attributes of this xml node. */ nuclear@0: virtual int getAttributeCount() const = 0; nuclear@0: nuclear@0: //! Returns name of an attribute. nuclear@0: /** \param idx: Zero based index, should be something between 0 and getAttributeCount()-1. nuclear@0: \return Name of the attribute, 0 if an attribute with this index does not exist. */ nuclear@0: virtual const char_type* getAttributeName(int idx) const = 0; nuclear@0: nuclear@0: //! Returns the value of an attribute. nuclear@0: /** \param idx: Zero based index, should be something between 0 and getAttributeCount()-1. nuclear@0: \return Value of the attribute, 0 if an attribute with this index does not exist. */ nuclear@0: virtual const char_type* getAttributeValue(int idx) const = 0; nuclear@0: nuclear@0: //! Returns the value of an attribute. nuclear@0: /** \param name: Name of the attribute. nuclear@0: \return Value of the attribute, 0 if an attribute with this name does not exist. */ nuclear@0: virtual const char_type* getAttributeValue(const char_type* name) const = 0; nuclear@0: nuclear@0: //! Returns the value of an attribute in a safe way. nuclear@0: /** Like getAttributeValue(), but does not nuclear@0: return 0 if the attribute does not exist. An empty string ("") is returned then. nuclear@0: \param name: Name of the attribute. nuclear@0: \return Value of the attribute, and "" if an attribute with this name does not exist */ nuclear@0: virtual const char_type* getAttributeValueSafe(const char_type* name) const = 0; nuclear@0: nuclear@0: //! Returns the value of an attribute as integer. nuclear@0: /** \param name Name of the attribute. nuclear@0: \return Value of the attribute as integer, and 0 if an attribute with this name does not exist or nuclear@0: the value could not be interpreted as integer. */ nuclear@0: virtual int getAttributeValueAsInt(const char_type* name) const = 0; nuclear@0: nuclear@0: //! Returns the value of an attribute as integer. nuclear@0: /** \param idx: Zero based index, should be something between 0 and getAttributeCount()-1. nuclear@0: \return Value of the attribute as integer, and 0 if an attribute with this index does not exist or nuclear@0: the value could not be interpreted as integer. */ nuclear@0: virtual int getAttributeValueAsInt(int idx) const = 0; nuclear@0: nuclear@0: //! Returns the value of an attribute as float. nuclear@0: /** \param name: Name of the attribute. nuclear@0: \return Value of the attribute as float, and 0 if an attribute with this name does not exist or nuclear@0: the value could not be interpreted as float. */ nuclear@0: virtual float getAttributeValueAsFloat(const char_type* name) const = 0; nuclear@0: nuclear@0: //! Returns the value of an attribute as float. nuclear@0: /** \param idx: Zero based index, should be something between 0 and getAttributeCount()-1. nuclear@0: \return Value of the attribute as float, and 0 if an attribute with this index does not exist or nuclear@0: the value could not be interpreted as float. */ nuclear@0: virtual float getAttributeValueAsFloat(int idx) const = 0; nuclear@0: nuclear@0: //! Returns the name of the current node. nuclear@0: /** Only non null, if the node type is EXN_ELEMENT. nuclear@0: \return Name of the current node or 0 if the node has no name. */ nuclear@0: virtual const char_type* getNodeName() const = 0; nuclear@0: nuclear@0: //! Returns data of the current node. nuclear@0: /** Only non null if the node has some nuclear@0: data and it is of type EXN_TEXT or EXN_UNKNOWN. */ nuclear@0: virtual const char_type* getNodeData() const = 0; nuclear@0: nuclear@0: //! Returns if an element is an empty element, like nuclear@0: virtual bool isEmptyElement() const = 0; nuclear@0: nuclear@0: //! Returns format of the source xml file. nuclear@0: /** It is not necessary to use nuclear@0: this method because the parser will convert the input file format nuclear@0: to the format wanted by the user when creating the parser. This nuclear@0: method is useful to get/display additional informations. */ nuclear@0: virtual ETEXT_FORMAT getSourceFormat() const = 0; nuclear@0: nuclear@0: //! Returns format of the strings returned by the parser. nuclear@0: /** This will be UTF8 for example when you created a parser with nuclear@0: IrrXMLReaderUTF8() and UTF32 when it has been created using nuclear@0: IrrXMLReaderUTF32. It should not be necessary to call this nuclear@0: method and only exists for informational purposes. */ nuclear@0: virtual ETEXT_FORMAT getParserFormat() const = 0; nuclear@0: }; nuclear@0: nuclear@0: nuclear@0: //! defines the utf-16 type. nuclear@0: /** Not using wchar_t for this because nuclear@0: wchar_t has 16 bit on windows and 32 bit on other operating systems. */ nuclear@0: typedef unsigned short char16; nuclear@0: nuclear@0: //! defines the utf-32 type. nuclear@0: /** Not using wchar_t for this because nuclear@0: wchar_t has 16 bit on windows and 32 bit on other operating systems. */ nuclear@0: typedef unsigned long char32; nuclear@0: nuclear@0: //! A UTF-8 or ASCII character xml parser. nuclear@0: /** This means that all character data will be returned in 8 bit ASCII or UTF-8 by this parser. nuclear@0: The file to read can be in any format, it will be converted to UTF-8 if it is not nuclear@0: in this format. nuclear@0: Create an instance of this with createIrrXMLReader(); nuclear@0: See IIrrXMLReader for description on how to use it. */ nuclear@0: typedef IIrrXMLReader IrrXMLReader; nuclear@0: nuclear@0: //! A UTF-16 xml parser. nuclear@0: /** This means that all character data will be returned in UTF-16 by this parser. nuclear@0: The file to read can be in any format, it will be converted to UTF-16 if it is not nuclear@0: in this format. nuclear@0: Create an instance of this with createIrrXMLReaderUTF16(); nuclear@0: See IIrrXMLReader for description on how to use it. */ nuclear@0: typedef IIrrXMLReader IrrXMLReaderUTF16; nuclear@0: nuclear@0: //! A UTF-32 xml parser. nuclear@0: /** This means that all character data will be returned in UTF-32 by this parser. nuclear@0: The file to read can be in any format, it will be converted to UTF-32 if it is not nuclear@0: in this format. nuclear@0: Create an instance of this with createIrrXMLReaderUTF32(); nuclear@0: See IIrrXMLReader for description on how to use it. */ nuclear@0: typedef IIrrXMLReader IrrXMLReaderUTF32; nuclear@0: nuclear@0: nuclear@0: //! Creates an instance of an UFT-8 or ASCII character xml parser. nuclear@0: /** This means that all character data will be returned in 8 bit ASCII or UTF-8. nuclear@0: The file to read can be in any format, it will be converted to UTF-8 if it is not in this format. nuclear@0: If you are using the Irrlicht Engine, it is better not to use this function but nuclear@0: IFileSystem::createXMLReaderUTF8() instead. nuclear@0: \param filename: Name of file to be opened. nuclear@0: \return Returns a pointer to the created xml parser. This pointer should be nuclear@0: deleted using 'delete' after no longer needed. Returns 0 if an error occured nuclear@0: and the file could not be opened. */ nuclear@0: IrrXMLReader* createIrrXMLReader(const char* filename); nuclear@0: nuclear@0: //! Creates an instance of an UFT-8 or ASCII character xml parser. nuclear@0: /** This means that all character data will be returned in 8 bit ASCII or UTF-8. The file to read can nuclear@0: be in any format, it will be converted to UTF-8 if it is not in this format. nuclear@0: If you are using the Irrlicht Engine, it is better not to use this function but nuclear@0: IFileSystem::createXMLReaderUTF8() instead. nuclear@0: \param file: Pointer to opened file, must have been opened in binary mode, e.g. nuclear@0: using fopen("foo.bar", "wb"); The file will not be closed after it has been read. nuclear@0: \return Returns a pointer to the created xml parser. This pointer should be nuclear@0: deleted using 'delete' after no longer needed. Returns 0 if an error occured nuclear@0: and the file could not be opened. */ nuclear@0: IrrXMLReader* createIrrXMLReader(FILE* file); nuclear@0: nuclear@0: //! Creates an instance of an UFT-8 or ASCII character xml parser. nuclear@0: /** This means that all character data will be returned in 8 bit ASCII or UTF-8. The file to read can nuclear@0: be in any format, it will be converted to UTF-8 if it is not in this format. nuclear@0: If you are using the Irrlicht Engine, it is better not to use this function but nuclear@0: IFileSystem::createXMLReaderUTF8() instead. nuclear@0: \param callback: Callback for file read abstraction. Implement your own nuclear@0: callback to make the xml parser read in other things than just files. See nuclear@0: IFileReadCallBack for more information about this. nuclear@0: \return Returns a pointer to the created xml parser. This pointer should be nuclear@0: deleted using 'delete' after no longer needed. Returns 0 if an error occured nuclear@0: and the file could not be opened. */ nuclear@0: IrrXMLReader* createIrrXMLReader(IFileReadCallBack* callback); nuclear@0: nuclear@0: //! Creates an instance of an UFT-16 xml parser. nuclear@0: /** This means that nuclear@0: all character data will be returned in UTF-16. The file to read can nuclear@0: be in any format, it will be converted to UTF-16 if it is not in this format. nuclear@0: If you are using the Irrlicht Engine, it is better not to use this function but nuclear@0: IFileSystem::createXMLReader() instead. nuclear@0: \param filename: Name of file to be opened. nuclear@0: \return Returns a pointer to the created xml parser. This pointer should be nuclear@0: deleted using 'delete' after no longer needed. Returns 0 if an error occured nuclear@0: and the file could not be opened. */ nuclear@0: IrrXMLReaderUTF16* createIrrXMLReaderUTF16(const char* filename); nuclear@0: nuclear@0: //! Creates an instance of an UFT-16 xml parser. nuclear@0: /** This means that all character data will be returned in UTF-16. The file to read can nuclear@0: be in any format, it will be converted to UTF-16 if it is not in this format. nuclear@0: If you are using the Irrlicht Engine, it is better not to use this function but nuclear@0: IFileSystem::createXMLReader() instead. nuclear@0: \param file: Pointer to opened file, must have been opened in binary mode, e.g. nuclear@0: using fopen("foo.bar", "wb"); The file will not be closed after it has been read. nuclear@0: \return Returns a pointer to the created xml parser. This pointer should be nuclear@0: deleted using 'delete' after no longer needed. Returns 0 if an error occured nuclear@0: and the file could not be opened. */ nuclear@0: IrrXMLReaderUTF16* createIrrXMLReaderUTF16(FILE* file); nuclear@0: nuclear@0: //! Creates an instance of an UFT-16 xml parser. nuclear@0: /** This means that all character data will be returned in UTF-16. The file to read can nuclear@0: be in any format, it will be converted to UTF-16 if it is not in this format. nuclear@0: If you are using the Irrlicht Engine, it is better not to use this function but nuclear@0: IFileSystem::createXMLReader() instead. nuclear@0: \param callback: Callback for file read abstraction. Implement your own nuclear@0: callback to make the xml parser read in other things than just files. See nuclear@0: IFileReadCallBack for more information about this. nuclear@0: \return Returns a pointer to the created xml parser. This pointer should be nuclear@0: deleted using 'delete' after no longer needed. Returns 0 if an error occured nuclear@0: and the file could not be opened. */ nuclear@0: IrrXMLReaderUTF16* createIrrXMLReaderUTF16(IFileReadCallBack* callback); nuclear@0: nuclear@0: nuclear@0: //! Creates an instance of an UFT-32 xml parser. nuclear@0: /** This means that all character data will be returned in UTF-32. The file to read can nuclear@0: be in any format, it will be converted to UTF-32 if it is not in this format. nuclear@0: If you are using the Irrlicht Engine, it is better not to use this function but nuclear@0: IFileSystem::createXMLReader() instead. nuclear@0: \param filename: Name of file to be opened. nuclear@0: \return Returns a pointer to the created xml parser. This pointer should be nuclear@0: deleted using 'delete' after no longer needed. Returns 0 if an error occured nuclear@0: and the file could not be opened. */ nuclear@0: IrrXMLReaderUTF32* createIrrXMLReaderUTF32(const char* filename); nuclear@0: nuclear@0: //! Creates an instance of an UFT-32 xml parser. nuclear@0: /** This means that all character data will be returned in UTF-32. The file to read can nuclear@0: be in any format, it will be converted to UTF-32 if it is not in this format. nuclear@0: if you are using the Irrlicht Engine, it is better not to use this function but nuclear@0: IFileSystem::createXMLReader() instead. nuclear@0: \param file: Pointer to opened file, must have been opened in binary mode, e.g. nuclear@0: using fopen("foo.bar", "wb"); The file will not be closed after it has been read. nuclear@0: \return Returns a pointer to the created xml parser. This pointer should be nuclear@0: deleted using 'delete' after no longer needed. Returns 0 if an error occured nuclear@0: and the file could not be opened. */ nuclear@0: IrrXMLReaderUTF32* createIrrXMLReaderUTF32(FILE* file); nuclear@0: nuclear@0: //! Creates an instance of an UFT-32 xml parser. nuclear@0: /** This means that nuclear@0: all character data will be returned in UTF-32. The file to read can nuclear@0: be in any format, it will be converted to UTF-32 if it is not in this format. nuclear@0: If you are using the Irrlicht Engine, it is better not to use this function but nuclear@0: IFileSystem::createXMLReader() instead. nuclear@0: \param callback: Callback for file read abstraction. Implement your own nuclear@0: callback to make the xml parser read in other things than just files. See nuclear@0: IFileReadCallBack for more information about this. nuclear@0: \return Returns a pointer to the created xml parser. This pointer should be nuclear@0: deleted using 'delete' after no longer needed. Returns 0 if an error occured nuclear@0: and the file could not be opened. */ nuclear@0: IrrXMLReaderUTF32* createIrrXMLReaderUTF32(IFileReadCallBack* callback); nuclear@0: nuclear@0: nuclear@0: /*! \file irrxml.h nuclear@0: \brief Header file of the irrXML, the Irrlicht XML parser. nuclear@0: nuclear@0: This file includes everything needed for using irrXML, nuclear@0: the XML parser of the Irrlicht Engine. To use irrXML, nuclear@0: you only need to include this file in your project: nuclear@0: nuclear@0: \code nuclear@0: #include nuclear@0: \endcode nuclear@0: nuclear@0: It is also common to use the two namespaces in which irrXML is included, nuclear@0: directly after #including irrXML.h: nuclear@0: nuclear@0: \code nuclear@0: #include nuclear@0: using namespace irr; nuclear@0: using namespace io; nuclear@0: \endcode nuclear@0: */ nuclear@0: nuclear@0: } // end namespace io nuclear@0: } // end namespace irr nuclear@0: nuclear@0: #endif // __IRR_XML_H_INCLUDED__ nuclear@0: