152 #ifndef __INCLUDE_XML_NODE__
153 #define __INCLUDE_XML_NODE__
169 #if defined(WIN32) || defined(UNDER_CE) || defined(_WIN32) || \
170 defined(WIN64) || defined(__BORLANDC__)
179 #ifdef _USE_XMLPARSER_DLL
181 #define XMLDLLENTRY __declspec(dllexport)
183 #define XMLDLLENTRY __declspec(dllimport)
195 #define XML_NO_WIDE_CHAR
196 #define strcasecmp(a, b) stricmp(a, b)
197 #define strncasecmp(a, b, c) _strnicmp(a, b, c)
199 #define _ftime(a) ftime(a)
200 #define _strnicmp(a, b, c) strnicmp(a, b, c)
201 #define _errno errno #endif
204 #ifdef XML_NO_WIDE_CHAR
213 #ifndef XML_NO_WIDE_CHAR
221 #define _CXML(c) L##c
222 #define XMLCSTR const wchar_t*
223 #define XMLSTR wchar_t*
224 #define XMLCHAR wchar_t
227 #define XMLCSTR const char*
421 XMLSTR createXMLString(
int nFormat = 1,
int* pnSize =
nullptr)
const;
432 XMLCSTR filename,
const char* encoding =
nullptr,
433 char nFormat = 1)
const;
450 XMLCSTR getText(
int i = 0)
const;
453 XMLNode getChildNode(
int i = 0)
const;
469 XMLNode getChildNodeWithAttribute(
471 XMLCSTR attributeValue =
nullptr,
472 int* i =
nullptr)
const;
476 XMLSTR path,
char createNodeIfMissing = 0,
XMLCHAR sep =
'/');
485 int nChildNode()
const;
487 XMLCSTR getAttributeName(
int i = 0)
const;
488 XMLCSTR getAttributeValue(
int i = 0)
const;
503 int nAttribute()
const;
510 int nElement()
const;
511 char isEmpty()
const;
512 char isDeclaration()
const;
543 static XMLNode createXMLTopNode(
625 void deleteNodeContent();
629 void deleteAttribute(
631 void deleteAttribute(
XMLCSTR lpszName);
643 void deleteText(
XMLCSTR lpszValue);
650 void deleteClear(
XMLCSTR lpszValue);
693 static XMLNode createXMLTopNode_WOSD(
779 char_encoding_error = 0,
780 char_encoding_UTF8 = 1,
781 char_encoding_legacy = 2,
782 char_encoding_ShiftJIS = 3,
783 char_encoding_GB2312 = 4,
784 char_encoding_Big5 = 5,
785 char_encoding_GBK = 6
792 static char setGlobalOptions(
870 static XMLCharEncoding guessCharEncoding(
871 void*
buffer,
int bufLen,
char useXMLEncodingAttribute = 1);
919 char parseClearTag(
void* px,
void* pa);
920 char maybeAddTxT(
void* pa,
XMLCSTR tokenPStr);
921 int ParseXMLElement(
void* pXML);
924 int indexText(
XMLCSTR lpszValue)
const;
925 int indexClear(
XMLCSTR lpszValue)
const;
930 void emptyTheNode(
char force);
933 static int CreateXMLStringR(
1027 static XMLSTR toXMLUnSafe(
1029 static int lengthXMLString(
1070 static int encodeLength(
int inBufLen,
char formatted = 0);
1087 unsigned char* inByteBuf,
unsigned int inByteLen,
1088 char formatted = 0);
1093 static unsigned int decodeSize(
XMLCSTR inString,
XMLError* xe =
nullptr);
1102 unsigned char* decode(
1103 XMLCSTR inString,
int* outByteLen =
nullptr,
1114 static unsigned char decode(
1115 XMLCSTR inString,
unsigned char* outByteBuf,
int inMaxByteOutBuflen,
1121 void alloc(
int newsize);
GLubyte GLubyte GLubyte a
GLuint const GLchar * name
GLsizei GLsizei GLchar * source
XMLDLLENTRY void freeXMLString(XMLSTR t)
to free the string allocated inside the "stringDup" function or the "createXMLString" function.
XMLDLLENTRY XMLSTR stringDup(XMLCSTR source, int cbData=-1)
Duplicate (copy in a new allocated buffer) the source string.
XMLDLLENTRY int xmltoi(XMLCSTR xmlString, int defautValue=0)
XMLDLLENTRY XMLCSTR xmltoa(XMLCSTR xmlString, XMLCSTR defautValue=_CXML(""))
XMLDLLENTRY long xmltol(XMLCSTR xmlString, long defautValue=0)
XMLDLLENTRY XMLCHAR xmltoc(XMLCSTR xmlString, XMLCHAR defautValue=_CXML('\0'))
XMLDLLENTRY char xmltob(XMLCSTR xmlString, char defautValue=0)
XMLDLLENTRY double xmltof(XMLCSTR xmlString, double defautValue=.0)
Structure for XML attribute.
Structure for XML clear (unformatted) node (usually comments)
XMLAttribute * pAttribute
struct XMLNodeDataTag * pParent
This structure is given by the function XMLNode::enumContents.
enum XMLElementType etype
This dictates what's the content of the XMLNodeContent.
Main Class representing a XML node.
struct XMLNode::XMLNodeDataTag XMLNodeData
XMLCharEncoding
childNode with the specified name if (name==nullptr) return the position of the ith childNode
static XMLNode emptyXMLNode
XMLNode(struct XMLNodeDataTag *pParent, XMLSTR lpszName, char isDeclaration)
Constructors are protected, so use instead one of: XMLNode::parseString, XMLNode::parseFile,...
static XMLClear emptyXMLClear
static XMLAttribute emptyXMLAttribute
Structure used to obtain error details if the parse fails.
static char dropWhiteSpace
static XMLNode::XMLCharEncoding characterEncoding
static char removeCommentsInMiddleOfText
static char guessWideCharChars
XMLElementType
Enumeration used to manage type of data.
struct XMLResults XMLResults
Structure used to obtain error details if the parse fails.
struct XMLDLLENTRY XMLNode XMLNode
Main Class representing a XML node.
struct XMLClear XMLClear
Structure for XML clear (unformatted) node (usually comments)
struct XMLAttribute XMLAttribute
Structure for XML attribute.
int XMLElementPosition
XMLElementPosition are not interchangeable with simple indexes.
XMLError
Enumeration for XML parse errors.
@ eXMLErrorCannotWriteFile
@ eXMLErrorUnexpectedToken
@ eXMLErrorMissingEndTagName
@ eXMLErrorCharacterCodeAbove255
@ eXMLErrorUnmatchedEndTag
@ eXMLErrorCharConversionError
@ eXMLErrorFirstTagNotFound
@ eXMLErrorBase64DataSizeIsNotMultipleOf4
@ eXMLErrorCannotOpenWriteFile
@ eXMLErrorUnmatchedEndClearTag
@ eXMLErrorMissingTagName
@ eXMLErrorBase64DecodeBufferTooSmall
@ eXMLErrorUnknownCharacterEntity
@ eXMLErrorBase64DecodeTruncatedData
@ eXMLErrorBase64DecodeIllegalCharacter
struct XMLNodeContents XMLNodeContents
This structure is given by the function XMLNode::enumContents.