vrshoot
diff libs/assimp/irrXML/irrXML.h @ 0:b2f14e535253
initial commit
author | John Tsiombikas <nuclear@member.fsf.org> |
---|---|
date | Sat, 01 Feb 2014 19:58:19 +0200 |
parents | |
children |
line diff
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/libs/assimp/irrXML/irrXML.h Sat Feb 01 19:58:19 2014 +0200 1.3 @@ -0,0 +1,540 @@ 1.4 +// Copyright (C) 2002-2005 Nikolaus Gebhardt 1.5 +// This file is part of the "Irrlicht Engine" and the "irrXML" project. 1.6 +// For conditions of distribution and use, see copyright notice in irrlicht.h and/or irrXML.h 1.7 + 1.8 +#ifndef __IRR_XML_H_INCLUDED__ 1.9 +#define __IRR_XML_H_INCLUDED__ 1.10 + 1.11 +#include <stdio.h> 1.12 + 1.13 +/** \mainpage irrXML 1.2 API documentation 1.14 + <div align="center"><img src="logobig.png" ></div> 1.15 + 1.16 + \section intro Introduction 1.17 + 1.18 + Welcome to the irrXML API documentation. 1.19 + Here you'll find any information you'll need to develop applications with 1.20 + irrXML. If you look for a tutorial on how to start, take a look at the \ref irrxmlexample, 1.21 + at the homepage of irrXML at <A HREF="http://xml.irrlicht3d.org" >xml.irrlicht3d.org</A> 1.22 + or into the SDK in the directory \example. 1.23 + 1.24 + irrXML is intended to be a high speed and easy-to-use XML Parser for C++, and 1.25 + this documentation is an important part of it. If you have any questions or 1.26 + suggestions, just send a email to the author of the engine, Nikolaus Gebhardt 1.27 + (niko (at) irrlicht3d.org). For more informations about this parser, see \ref history. 1.28 + 1.29 + \section features Features 1.30 + 1.31 + irrXML provides forward-only, read-only 1.32 + access to a stream of non validated XML data. It was fully implemented by 1.33 + Nikolaus Gebhardt. Its current features are: 1.34 + 1.35 + - It it fast as lighting and has very low memory usage. It was 1.36 + developed with the intention of being used in 3D games, as it already has been. 1.37 + - irrXML is very small: It only consists of 60 KB of code and can be added easily 1.38 + to your existing project. 1.39 + - Of course, it is platform independent and works with lots of compilers. 1.40 + - It is able to parse ASCII, UTF-8, UTF-16 and UTF-32 text files, both in 1.41 + little and big endian format. 1.42 + - Independent of the input file format, the parser can return all strings in ASCII, UTF-8, 1.43 + UTF-16 and UTF-32 format. 1.44 + - With its optional file access abstraction it has the advantage that it can read not 1.45 + only from files but from any type of data (memory, network, ...). For example when 1.46 + used with the Irrlicht Engine, it directly reads from compressed .zip files. 1.47 + - Just like the Irrlicht Engine for which it was originally created, it is extremely easy 1.48 + to use. 1.49 + - It has no external dependencies, it does not even need the STL. 1.50 + 1.51 + Although irrXML has some strenghts, it currently also has the following limitations: 1.52 + 1.53 + - The input xml file is not validated and assumed to be correct. 1.54 + 1.55 + \section irrxmlexample Example 1.56 + 1.57 + The following code demonstrates the basic usage of irrXML. A simple xml 1.58 + file like this is parsed: 1.59 + \code 1.60 + <?xml version="1.0"?> 1.61 + <config> 1.62 + <!-- This is a config file for the mesh viewer --> 1.63 + <model file="dwarf.dea" /> 1.64 + <messageText caption="Irrlicht Engine Mesh Viewer"> 1.65 + Welcome to the Mesh Viewer of the "Irrlicht Engine". 1.66 + </messageText> 1.67 + </config> 1.68 + \endcode 1.69 + 1.70 + The code for parsing this file would look like this: 1.71 + \code 1.72 + #include <irrXML.h> 1.73 + using namespace irr; // irrXML is located in the namespace irr::io 1.74 + using namespace io; 1.75 + 1.76 + #include <string> // we use STL strings to store data in this example 1.77 + 1.78 + void main() 1.79 + { 1.80 + // create the reader using one of the factory functions 1.81 + 1.82 + IrrXMLReader* xml = createIrrXMLReader("config.xml"); 1.83 + 1.84 + // strings for storing the data we want to get out of the file 1.85 + std::string modelFile; 1.86 + std::string messageText; 1.87 + std::string caption; 1.88 + 1.89 + // parse the file until end reached 1.90 + 1.91 + while(xml && xml->read()) 1.92 + { 1.93 + switch(xml->getNodeType()) 1.94 + { 1.95 + case EXN_TEXT: 1.96 + // in this xml file, the only text which occurs is the messageText 1.97 + messageText = xml->getNodeData(); 1.98 + break; 1.99 + case EXN_ELEMENT: 1.100 + { 1.101 + if (!strcmp("model", xml->getNodeName())) 1.102 + modelFile = xml->getAttributeValue("file"); 1.103 + else 1.104 + if (!strcmp("messageText", xml->getNodeName())) 1.105 + caption = xml->getAttributeValue("caption"); 1.106 + } 1.107 + break; 1.108 + } 1.109 + } 1.110 + 1.111 + // delete the xml parser after usage 1.112 + delete xml; 1.113 + } 1.114 + \endcode 1.115 + 1.116 + \section howto How to use 1.117 + 1.118 + Simply add the source files in the /src directory of irrXML to your project. Done. 1.119 + 1.120 + \section license License 1.121 + 1.122 + The irrXML license is based on the zlib license. Basicly, this means you can do with 1.123 + irrXML whatever you want: 1.124 + 1.125 + Copyright (C) 2002-2005 Nikolaus Gebhardt 1.126 + 1.127 + This software is provided 'as-is', without any express or implied 1.128 + warranty. In no event will the authors be held liable for any damages 1.129 + arising from the use of this software. 1.130 + 1.131 + Permission is granted to anyone to use this software for any purpose, 1.132 + including commercial applications, and to alter it and redistribute it 1.133 + freely, subject to the following restrictions: 1.134 + 1.135 + 1. The origin of this software must not be misrepresented; you must not 1.136 + claim that you wrote the original software. If you use this software 1.137 + in a product, an acknowledgment in the product documentation would be 1.138 + appreciated but is not required. 1.139 + 1.140 + 2. Altered source versions must be plainly marked as such, and must not be 1.141 + misrepresented as being the original software. 1.142 + 1.143 + 3. This notice may not be removed or altered from any source distribution. 1.144 + 1.145 + \section history History 1.146 + 1.147 + As lots of references in this documentation and the source show, this xml 1.148 + parser has originally been a part of the 1.149 + <A HREF="http://irrlicht.sourceforge.net" >Irrlicht Engine</A>. But because 1.150 + the parser has become very useful with the latest release, people asked for a 1.151 + separate version of it, to be able to use it in non Irrlicht projects. With 1.152 + irrXML 1.0, this has now been done. 1.153 +*/ 1.154 + 1.155 +namespace irr 1.156 +{ 1.157 +namespace io 1.158 +{ 1.159 + //! Enumeration of all supported source text file formats 1.160 + enum ETEXT_FORMAT 1.161 + { 1.162 + //! ASCII, file without byte order mark, or not a text file 1.163 + ETF_ASCII, 1.164 + 1.165 + //! UTF-8 format 1.166 + ETF_UTF8, 1.167 + 1.168 + //! UTF-16 format, big endian 1.169 + ETF_UTF16_BE, 1.170 + 1.171 + //! UTF-16 format, little endian 1.172 + ETF_UTF16_LE, 1.173 + 1.174 + //! UTF-32 format, big endian 1.175 + ETF_UTF32_BE, 1.176 + 1.177 + //! UTF-32 format, little endian 1.178 + ETF_UTF32_LE 1.179 + }; 1.180 + 1.181 + 1.182 + //! Enumeration for all xml nodes which are parsed by IrrXMLReader 1.183 + enum EXML_NODE 1.184 + { 1.185 + //! No xml node. This is usually the node if you did not read anything yet. 1.186 + EXN_NONE, 1.187 + 1.188 + //! A xml element, like <foo> 1.189 + EXN_ELEMENT, 1.190 + 1.191 + //! End of an xml element, like </foo> 1.192 + EXN_ELEMENT_END, 1.193 + 1.194 + //! Text within a xml element: <foo> this is the text. </foo> 1.195 + EXN_TEXT, 1.196 + 1.197 + //! An xml comment like <!-- I am a comment --> or a DTD definition. 1.198 + EXN_COMMENT, 1.199 + 1.200 + //! An xml cdata section like <![CDATA[ this is some CDATA ]]> 1.201 + EXN_CDATA, 1.202 + 1.203 + //! Unknown element. 1.204 + EXN_UNKNOWN 1.205 + }; 1.206 + 1.207 + //! Callback class for file read abstraction. 1.208 + /** With this, it is possible to make the xml parser read in other things 1.209 + than just files. The Irrlicht engine is using this for example to 1.210 + read xml from compressed .zip files. To make the parser read in 1.211 + any other data, derive a class from this interface, implement the 1.212 + two methods to read your data and give a pointer to an instance of 1.213 + your implementation when calling createIrrXMLReader(), 1.214 + createIrrXMLReaderUTF16() or createIrrXMLReaderUTF32() */ 1.215 + class IFileReadCallBack 1.216 + { 1.217 + public: 1.218 + 1.219 + //! virtual destructor 1.220 + virtual ~IFileReadCallBack() {}; 1.221 + 1.222 + //! Reads an amount of bytes from the file. 1.223 + /** \param buffer: Pointer to buffer where to read bytes will be written to. 1.224 + \param sizeToRead: Amount of bytes to read from the file. 1.225 + \return Returns how much bytes were read. */ 1.226 + virtual int read(void* buffer, int sizeToRead) = 0; 1.227 + 1.228 + //! Returns size of file in bytes 1.229 + virtual int getSize() = 0; 1.230 + }; 1.231 + 1.232 + //! Empty class to be used as parent class for IrrXMLReader. 1.233 + /** If you need another class as base class for the xml reader, you can do this by creating 1.234 + the reader using for example new CXMLReaderImpl<char, YourBaseClass>(yourcallback); 1.235 + The Irrlicht Engine for example needs IUnknown as base class for every object to 1.236 + let it automaticly reference countend, hence it replaces IXMLBase with IUnknown. 1.237 + See irrXML.cpp on how this can be done in detail. */ 1.238 + class IXMLBase 1.239 + { 1.240 + }; 1.241 + 1.242 + //! Interface providing easy read access to a XML file. 1.243 + /** You can create an instance of this reader using one of the factory functions 1.244 + createIrrXMLReader(), createIrrXMLReaderUTF16() and createIrrXMLReaderUTF32(). 1.245 + If using the parser from the Irrlicht Engine, please use IFileSystem::createXMLReader() 1.246 + instead. 1.247 + For a detailed intro how to use the parser, see \ref irrxmlexample and \ref features. 1.248 + 1.249 + The typical usage of this parser looks like this: 1.250 + \code 1.251 + #include <irrXML.h> 1.252 + using namespace irr; // irrXML is located in the namespace irr::io 1.253 + using namespace io; 1.254 + 1.255 + void main() 1.256 + { 1.257 + // create the reader using one of the factory functions 1.258 + IrrXMLReader* xml = createIrrXMLReader("config.xml"); 1.259 + 1.260 + if (xml == 0) 1.261 + return; // file could not be opened 1.262 + 1.263 + // parse the file until end reached 1.264 + while(xml->read()) 1.265 + { 1.266 + // based on xml->getNodeType(), do something. 1.267 + } 1.268 + 1.269 + // delete the xml parser after usage 1.270 + delete xml; 1.271 + } 1.272 + \endcode 1.273 + See \ref irrxmlexample for a more detailed example. 1.274 + */ 1.275 + template<class char_type, class super_class> 1.276 + class IIrrXMLReader : public super_class 1.277 + { 1.278 + public: 1.279 + 1.280 + //! Destructor 1.281 + virtual ~IIrrXMLReader() {}; 1.282 + 1.283 + //! Reads forward to the next xml node. 1.284 + /** \return Returns false, if there was no further node. */ 1.285 + virtual bool read() = 0; 1.286 + 1.287 + //! Returns the type of the current XML node. 1.288 + virtual EXML_NODE getNodeType() const = 0; 1.289 + 1.290 + //! Returns attribute count of the current XML node. 1.291 + /** This is usually 1.292 + non null if the current node is EXN_ELEMENT, and the element has attributes. 1.293 + \return Returns amount of attributes of this xml node. */ 1.294 + virtual int getAttributeCount() const = 0; 1.295 + 1.296 + //! Returns name of an attribute. 1.297 + /** \param idx: Zero based index, should be something between 0 and getAttributeCount()-1. 1.298 + \return Name of the attribute, 0 if an attribute with this index does not exist. */ 1.299 + virtual const char_type* getAttributeName(int idx) const = 0; 1.300 + 1.301 + //! Returns the value of an attribute. 1.302 + /** \param idx: Zero based index, should be something between 0 and getAttributeCount()-1. 1.303 + \return Value of the attribute, 0 if an attribute with this index does not exist. */ 1.304 + virtual const char_type* getAttributeValue(int idx) const = 0; 1.305 + 1.306 + //! Returns the value of an attribute. 1.307 + /** \param name: Name of the attribute. 1.308 + \return Value of the attribute, 0 if an attribute with this name does not exist. */ 1.309 + virtual const char_type* getAttributeValue(const char_type* name) const = 0; 1.310 + 1.311 + //! Returns the value of an attribute in a safe way. 1.312 + /** Like getAttributeValue(), but does not 1.313 + return 0 if the attribute does not exist. An empty string ("") is returned then. 1.314 + \param name: Name of the attribute. 1.315 + \return Value of the attribute, and "" if an attribute with this name does not exist */ 1.316 + virtual const char_type* getAttributeValueSafe(const char_type* name) const = 0; 1.317 + 1.318 + //! Returns the value of an attribute as integer. 1.319 + /** \param name Name of the attribute. 1.320 + \return Value of the attribute as integer, and 0 if an attribute with this name does not exist or 1.321 + the value could not be interpreted as integer. */ 1.322 + virtual int getAttributeValueAsInt(const char_type* name) const = 0; 1.323 + 1.324 + //! Returns the value of an attribute as integer. 1.325 + /** \param idx: Zero based index, should be something between 0 and getAttributeCount()-1. 1.326 + \return Value of the attribute as integer, and 0 if an attribute with this index does not exist or 1.327 + the value could not be interpreted as integer. */ 1.328 + virtual int getAttributeValueAsInt(int idx) const = 0; 1.329 + 1.330 + //! Returns the value of an attribute as float. 1.331 + /** \param name: Name of the attribute. 1.332 + \return Value of the attribute as float, and 0 if an attribute with this name does not exist or 1.333 + the value could not be interpreted as float. */ 1.334 + virtual float getAttributeValueAsFloat(const char_type* name) const = 0; 1.335 + 1.336 + //! Returns the value of an attribute as float. 1.337 + /** \param idx: Zero based index, should be something between 0 and getAttributeCount()-1. 1.338 + \return Value of the attribute as float, and 0 if an attribute with this index does not exist or 1.339 + the value could not be interpreted as float. */ 1.340 + virtual float getAttributeValueAsFloat(int idx) const = 0; 1.341 + 1.342 + //! Returns the name of the current node. 1.343 + /** Only non null, if the node type is EXN_ELEMENT. 1.344 + \return Name of the current node or 0 if the node has no name. */ 1.345 + virtual const char_type* getNodeName() const = 0; 1.346 + 1.347 + //! Returns data of the current node. 1.348 + /** Only non null if the node has some 1.349 + data and it is of type EXN_TEXT or EXN_UNKNOWN. */ 1.350 + virtual const char_type* getNodeData() const = 0; 1.351 + 1.352 + //! Returns if an element is an empty element, like <foo /> 1.353 + virtual bool isEmptyElement() const = 0; 1.354 + 1.355 + //! Returns format of the source xml file. 1.356 + /** It is not necessary to use 1.357 + this method because the parser will convert the input file format 1.358 + to the format wanted by the user when creating the parser. This 1.359 + method is useful to get/display additional informations. */ 1.360 + virtual ETEXT_FORMAT getSourceFormat() const = 0; 1.361 + 1.362 + //! Returns format of the strings returned by the parser. 1.363 + /** This will be UTF8 for example when you created a parser with 1.364 + IrrXMLReaderUTF8() and UTF32 when it has been created using 1.365 + IrrXMLReaderUTF32. It should not be necessary to call this 1.366 + method and only exists for informational purposes. */ 1.367 + virtual ETEXT_FORMAT getParserFormat() const = 0; 1.368 + }; 1.369 + 1.370 + 1.371 + //! defines the utf-16 type. 1.372 + /** Not using wchar_t for this because 1.373 + wchar_t has 16 bit on windows and 32 bit on other operating systems. */ 1.374 + typedef unsigned short char16; 1.375 + 1.376 + //! defines the utf-32 type. 1.377 + /** Not using wchar_t for this because 1.378 + wchar_t has 16 bit on windows and 32 bit on other operating systems. */ 1.379 + typedef unsigned long char32; 1.380 + 1.381 + //! A UTF-8 or ASCII character xml parser. 1.382 + /** This means that all character data will be returned in 8 bit ASCII or UTF-8 by this parser. 1.383 + The file to read can be in any format, it will be converted to UTF-8 if it is not 1.384 + in this format. 1.385 + Create an instance of this with createIrrXMLReader(); 1.386 + See IIrrXMLReader for description on how to use it. */ 1.387 + typedef IIrrXMLReader<char, IXMLBase> IrrXMLReader; 1.388 + 1.389 + //! A UTF-16 xml parser. 1.390 + /** This means that all character data will be returned in UTF-16 by this parser. 1.391 + The file to read can be in any format, it will be converted to UTF-16 if it is not 1.392 + in this format. 1.393 + Create an instance of this with createIrrXMLReaderUTF16(); 1.394 + See IIrrXMLReader for description on how to use it. */ 1.395 + typedef IIrrXMLReader<char16, IXMLBase> IrrXMLReaderUTF16; 1.396 + 1.397 + //! A UTF-32 xml parser. 1.398 + /** This means that all character data will be returned in UTF-32 by this parser. 1.399 + The file to read can be in any format, it will be converted to UTF-32 if it is not 1.400 + in this format. 1.401 + Create an instance of this with createIrrXMLReaderUTF32(); 1.402 + See IIrrXMLReader for description on how to use it. */ 1.403 + typedef IIrrXMLReader<char32, IXMLBase> IrrXMLReaderUTF32; 1.404 + 1.405 + 1.406 + //! Creates an instance of an UFT-8 or ASCII character xml parser. 1.407 + /** This means that all character data will be returned in 8 bit ASCII or UTF-8. 1.408 + The file to read can be in any format, it will be converted to UTF-8 if it is not in this format. 1.409 + If you are using the Irrlicht Engine, it is better not to use this function but 1.410 + IFileSystem::createXMLReaderUTF8() instead. 1.411 + \param filename: Name of file to be opened. 1.412 + \return Returns a pointer to the created xml parser. This pointer should be 1.413 + deleted using 'delete' after no longer needed. Returns 0 if an error occured 1.414 + and the file could not be opened. */ 1.415 + IrrXMLReader* createIrrXMLReader(const char* filename); 1.416 + 1.417 + //! Creates an instance of an UFT-8 or ASCII character xml parser. 1.418 + /** This means that all character data will be returned in 8 bit ASCII or UTF-8. The file to read can 1.419 + be in any format, it will be converted to UTF-8 if it is not in this format. 1.420 + If you are using the Irrlicht Engine, it is better not to use this function but 1.421 + IFileSystem::createXMLReaderUTF8() instead. 1.422 + \param file: Pointer to opened file, must have been opened in binary mode, e.g. 1.423 + using fopen("foo.bar", "wb"); The file will not be closed after it has been read. 1.424 + \return Returns a pointer to the created xml parser. This pointer should be 1.425 + deleted using 'delete' after no longer needed. Returns 0 if an error occured 1.426 + and the file could not be opened. */ 1.427 + IrrXMLReader* createIrrXMLReader(FILE* file); 1.428 + 1.429 + //! Creates an instance of an UFT-8 or ASCII character xml parser. 1.430 + /** This means that all character data will be returned in 8 bit ASCII or UTF-8. The file to read can 1.431 + be in any format, it will be converted to UTF-8 if it is not in this format. 1.432 + If you are using the Irrlicht Engine, it is better not to use this function but 1.433 + IFileSystem::createXMLReaderUTF8() instead. 1.434 + \param callback: Callback for file read abstraction. Implement your own 1.435 + callback to make the xml parser read in other things than just files. See 1.436 + IFileReadCallBack for more information about this. 1.437 + \return Returns a pointer to the created xml parser. This pointer should be 1.438 + deleted using 'delete' after no longer needed. Returns 0 if an error occured 1.439 + and the file could not be opened. */ 1.440 + IrrXMLReader* createIrrXMLReader(IFileReadCallBack* callback); 1.441 + 1.442 + //! Creates an instance of an UFT-16 xml parser. 1.443 + /** This means that 1.444 + all character data will be returned in UTF-16. The file to read can 1.445 + be in any format, it will be converted to UTF-16 if it is not in this format. 1.446 + If you are using the Irrlicht Engine, it is better not to use this function but 1.447 + IFileSystem::createXMLReader() instead. 1.448 + \param filename: Name of file to be opened. 1.449 + \return Returns a pointer to the created xml parser. This pointer should be 1.450 + deleted using 'delete' after no longer needed. Returns 0 if an error occured 1.451 + and the file could not be opened. */ 1.452 + IrrXMLReaderUTF16* createIrrXMLReaderUTF16(const char* filename); 1.453 + 1.454 + //! Creates an instance of an UFT-16 xml parser. 1.455 + /** This means that all character data will be returned in UTF-16. The file to read can 1.456 + be in any format, it will be converted to UTF-16 if it is not in this format. 1.457 + If you are using the Irrlicht Engine, it is better not to use this function but 1.458 + IFileSystem::createXMLReader() instead. 1.459 + \param file: Pointer to opened file, must have been opened in binary mode, e.g. 1.460 + using fopen("foo.bar", "wb"); The file will not be closed after it has been read. 1.461 + \return Returns a pointer to the created xml parser. This pointer should be 1.462 + deleted using 'delete' after no longer needed. Returns 0 if an error occured 1.463 + and the file could not be opened. */ 1.464 + IrrXMLReaderUTF16* createIrrXMLReaderUTF16(FILE* file); 1.465 + 1.466 + //! Creates an instance of an UFT-16 xml parser. 1.467 + /** This means that all character data will be returned in UTF-16. The file to read can 1.468 + be in any format, it will be converted to UTF-16 if it is not in this format. 1.469 + If you are using the Irrlicht Engine, it is better not to use this function but 1.470 + IFileSystem::createXMLReader() instead. 1.471 + \param callback: Callback for file read abstraction. Implement your own 1.472 + callback to make the xml parser read in other things than just files. See 1.473 + IFileReadCallBack for more information about this. 1.474 + \return Returns a pointer to the created xml parser. This pointer should be 1.475 + deleted using 'delete' after no longer needed. Returns 0 if an error occured 1.476 + and the file could not be opened. */ 1.477 + IrrXMLReaderUTF16* createIrrXMLReaderUTF16(IFileReadCallBack* callback); 1.478 + 1.479 + 1.480 + //! Creates an instance of an UFT-32 xml parser. 1.481 + /** This means that all character data will be returned in UTF-32. The file to read can 1.482 + be in any format, it will be converted to UTF-32 if it is not in this format. 1.483 + If you are using the Irrlicht Engine, it is better not to use this function but 1.484 + IFileSystem::createXMLReader() instead. 1.485 + \param filename: Name of file to be opened. 1.486 + \return Returns a pointer to the created xml parser. This pointer should be 1.487 + deleted using 'delete' after no longer needed. Returns 0 if an error occured 1.488 + and the file could not be opened. */ 1.489 + IrrXMLReaderUTF32* createIrrXMLReaderUTF32(const char* filename); 1.490 + 1.491 + //! Creates an instance of an UFT-32 xml parser. 1.492 + /** This means that all character data will be returned in UTF-32. The file to read can 1.493 + be in any format, it will be converted to UTF-32 if it is not in this format. 1.494 + if you are using the Irrlicht Engine, it is better not to use this function but 1.495 + IFileSystem::createXMLReader() instead. 1.496 + \param file: Pointer to opened file, must have been opened in binary mode, e.g. 1.497 + using fopen("foo.bar", "wb"); The file will not be closed after it has been read. 1.498 + \return Returns a pointer to the created xml parser. This pointer should be 1.499 + deleted using 'delete' after no longer needed. Returns 0 if an error occured 1.500 + and the file could not be opened. */ 1.501 + IrrXMLReaderUTF32* createIrrXMLReaderUTF32(FILE* file); 1.502 + 1.503 + //! Creates an instance of an UFT-32 xml parser. 1.504 + /** This means that 1.505 + all character data will be returned in UTF-32. The file to read can 1.506 + be in any format, it will be converted to UTF-32 if it is not in this format. 1.507 + If you are using the Irrlicht Engine, it is better not to use this function but 1.508 + IFileSystem::createXMLReader() instead. 1.509 + \param callback: Callback for file read abstraction. Implement your own 1.510 + callback to make the xml parser read in other things than just files. See 1.511 + IFileReadCallBack for more information about this. 1.512 + \return Returns a pointer to the created xml parser. This pointer should be 1.513 + deleted using 'delete' after no longer needed. Returns 0 if an error occured 1.514 + and the file could not be opened. */ 1.515 + IrrXMLReaderUTF32* createIrrXMLReaderUTF32(IFileReadCallBack* callback); 1.516 + 1.517 + 1.518 + /*! \file irrxml.h 1.519 + \brief Header file of the irrXML, the Irrlicht XML parser. 1.520 + 1.521 + This file includes everything needed for using irrXML, 1.522 + the XML parser of the Irrlicht Engine. To use irrXML, 1.523 + you only need to include this file in your project: 1.524 + 1.525 + \code 1.526 + #include <irrXML.h> 1.527 + \endcode 1.528 + 1.529 + It is also common to use the two namespaces in which irrXML is included, 1.530 + directly after #including irrXML.h: 1.531 + 1.532 + \code 1.533 + #include <irrXML.h> 1.534 + using namespace irr; 1.535 + using namespace io; 1.536 + \endcode 1.537 + */ 1.538 + 1.539 +} // end namespace io 1.540 +} // end namespace irr 1.541 + 1.542 +#endif // __IRR_XML_H_INCLUDED__ 1.543 +