5#ifndef __IRR_XML_H_INCLUDED__
6#define __IRR_XML_H_INCLUDED__
9#include "IrrCompileConfig.h"
225 virtual int read(
void* buffer,
int sizeToRead) = 0;
274 template<
class char_type,
class super_
class>
370 template <
typename T>
375 xmlChar<T>(
char in) : c(
static_cast<T
>(in)) {}
376 xmlChar<T>(
wchar_t in) : c(
static_cast<T
>(in)) {}
377#if defined(__BORLANDC__)
380 xmlChar<T>(
unsigned char in) : c(
static_cast<T
>(in)) {}
381 xmlChar<T>(
unsigned short in) : c(
static_cast<T
>(in)) {}
382 xmlChar<T>(
unsigned int in) : c(
static_cast<T
>(in)) {}
383 xmlChar<T>(
unsigned long in) : c(
static_cast<T
>(in)) {}
385 explicit xmlChar<T>(
unsigned char in) : c(
static_cast<T
>(in)) {}
387#if !defined(_MSC_VER) || defined(_NATIVE_WCHAR_T_DEFINED)
388 explicit xmlChar<T>(
unsigned short in) : c(
static_cast<T
>(in)) {}
390 explicit xmlChar<T>(
unsigned int in) : c(
static_cast<T
>(in)) {}
391 explicit xmlChar<T>(
unsigned long in) : c(
static_cast<T
>(in)) {}
393 operator T()
const {
return c; }
394 void operator=(
int t) { c=
static_cast<T
>(t); }
431#ifdef _IRR_COMPILE_WITH_XML_
470 bool deleteCallback =
false);
510 bool deleteCallback =
false);
551 bool deleteCallback =
false);
Callback class for file read abstraction.
Definition irrXML.h:215
virtual ~IFileReadCallBack()
Destructor.
Definition irrXML.h:219
virtual long getSize() const =0
Returns size of file in bytes.
virtual int read(void *buffer, int sizeToRead)=0
Reads an amount of bytes from the file.
Interface providing easy read access to a XML file.
Definition irrXML.h:276
virtual ETEXT_FORMAT getSourceFormat() const =0
Returns format of the source xml file.
virtual bool read()=0
Reads forward to the next xml node.
virtual float getAttributeValueAsFloat(const char_type *name) const =0
Returns the value of an attribute as float.
virtual EXML_NODE getNodeType() const =0
Returns the type of the current XML node.
virtual const char_type * getAttributeValueSafe(const char_type *name) const =0
Returns the value of an attribute in a safe way.
virtual float getAttributeValueAsFloat(int idx) const =0
Returns the value of an attribute as float.
virtual bool isEmptyElement() const =0
Returns if an element is an empty element, like <foo />.
virtual const char_type * getNodeName() const =0
Returns the name of the current node.
virtual int getAttributeValueAsInt(int idx) const =0
Returns the value of an attribute as integer.
virtual unsigned int getAttributeCount() const =0
Returns attribute count of the current XML node.
virtual ETEXT_FORMAT getParserFormat() const =0
Returns format of the strings returned by the parser.
virtual const char_type * getAttributeValue(const char_type *name) const =0
Returns the value of an attribute.
virtual const char_type * getAttributeName(int idx) const =0
Returns name of an attribute.
virtual int getAttributeValueAsInt(const char_type *name) const =0
Returns the value of an attribute as integer.
virtual const char_type * getAttributeValue(int idx) const =0
Returns the value of an attribute.
virtual ~IIrrXMLReader()
Destructor.
Definition irrXML.h:280
virtual const char_type * getNodeData() const =0
Returns data of the current node.
Empty class to be used as parent class for IrrXMLReader.
Definition irrXML.h:238
This namespace provides interfaces for input/output: Reading and writing files, accessing zip archive...
Definition EAttributes.h:11
IIrrXMLReader< char, IXMLBase > IrrXMLReader
A UTF-8 or ASCII character xml parser.
Definition irrXML.h:413
IRRLICHT_API IrrXMLReaderUTF16 *IRRCALLCONV createIrrXMLReaderUTF16(const char *filename)
Creates an instance of an UFT-16 xml parser.
IIrrXMLReader< char16, IXMLBase > IrrXMLReaderUTF16
A UTF-16 xml parser.
Definition irrXML.h:421
IRRLICHT_API IrrXMLReader *IRRCALLCONV createIrrXMLReader(const char *filename)
Creates an instance of an UFT-8 or ASCII character xml parser.
IRRLICHT_API IrrXMLReaderUTF32 *IRRCALLCONV createIrrXMLReaderUTF32(const char *filename)
Creates an instance of an UFT-32 xml parser.
IIrrXMLReader< char32, IXMLBase > IrrXMLReaderUTF32
A UTF-32 xml parser.
Definition irrXML.h:429
EXML_NODE
Enumeration for all xml nodes which are parsed by IrrXMLReader.
Definition irrXML.h:182
@ EXN_TEXT
Definition irrXML.h:194
@ EXN_ELEMENT_END
End of an xml element such as </foo>.
Definition irrXML.h:190
@ EXN_ELEMENT
An xml element such as <foo>.
Definition irrXML.h:187
@ EXN_NONE
No xml node. This is usually the node if you did not read anything yet.
Definition irrXML.h:184
@ EXN_CDATA
An xml cdata section like <![CDATA[ this is some CDATA ]]>.
Definition irrXML.h:200
@ EXN_COMMENT
An xml comment like <!– I am a comment –> or a DTD definition.
Definition irrXML.h:197
@ EXN_UNKNOWN
Unknown element.
Definition irrXML.h:203
xmlChar< unsigned short > char16
defines the utf-16 type.
Definition irrXML.h:400
ETEXT_FORMAT
Enumeration of all supported source text file formats.
Definition irrXML.h:159
@ ETF_UTF32_LE
UTF-32 format, little endian.
Definition irrXML.h:176
@ ETF_UTF16_LE
UTF-16 format, little endian.
Definition irrXML.h:170
@ ETF_UTF16_BE
UTF-16 format, big endian.
Definition irrXML.h:167
@ ETF_UTF32_BE
UTF-32 format, big endian.
Definition irrXML.h:173
@ ETF_ASCII
ASCII, file without byte order mark, or not a text file.
Definition irrXML.h:161
@ ETF_UTF8
UTF-8 format.
Definition irrXML.h:164
xmlChar< unsigned int > char32
defines the utf-32 type.
Definition irrXML.h:405
Everything in the Irrlicht Engine can be found in this namespace.
Definition Skylicht.h:33