Go to the documentation of this file.
152 #ifndef __INCLUDE_XML_NODE__
153 #define __INCLUDE_XML_NODE__
169 #if defined(WIN32) || defined(UNDER_CE) || defined(_WIN32) || defined(WIN64)
178 #ifdef _USE_XMLPARSER_DLL
180 #define XMLDLLENTRY __declspec(dllexport)
182 #define XMLDLLENTRY __declspec(dllimport)
194 #define XML_NO_WIDE_CHAR
195 #define strcasecmp(a, b) stricmp(a, b)
196 #define strncasecmp(a, b, c) _strnicmp(a, b, c)
198 #define _ftime(a) ftime(a)
199 #define _strnicmp(a, b, c) strnicmp(a, b, c)
200 #define _errno errno #endif
203 #ifdef XML_NO_WIDE_CHAR
212 #ifndef XML_NO_WIDE_CHAR
220 #define _CXML(c) L##c
221 #define XMLCSTR const wchar_t*
222 #define XMLSTR wchar_t*
223 #define XMLCHAR wchar_t
226 #define XMLCSTR const char*
420 XMLSTR createXMLString(
int nFormat = 1,
int* pnSize =
nullptr)
const;
431 XMLCSTR filename,
const char* encoding =
nullptr,
432 char nFormat = 1)
const;
449 XMLCSTR getText(
int i = 0)
const;
452 XMLNode getChildNode(
int i = 0)
const;
468 XMLNode getChildNodeWithAttribute(
470 XMLCSTR attributeValue =
nullptr,
471 int* i =
nullptr)
const;
475 XMLSTR path,
char createNodeIfMissing = 0,
XMLCHAR sep =
'/');
484 int nChildNode()
const;
486 XMLCSTR getAttributeName(
int i = 0)
const;
487 XMLCSTR getAttributeValue(
int i = 0)
const;
502 int nAttribute()
const;
509 int nElement()
const;
510 char isEmpty()
const;
511 char isDeclaration()
const;
542 static XMLNode createXMLTopNode(
624 void deleteNodeContent();
628 void deleteAttribute(
630 void deleteAttribute(
XMLCSTR lpszName);
642 void deleteText(
XMLCSTR lpszValue);
649 void deleteClear(
XMLCSTR lpszValue);
692 static XMLNode createXMLTopNode_WOSD(
778 char_encoding_error = 0,
779 char_encoding_UTF8 = 1,
780 char_encoding_legacy = 2,
781 char_encoding_ShiftJIS = 3,
782 char_encoding_GB2312 = 4,
783 char_encoding_Big5 = 5,
784 char_encoding_GBK = 6
791 static char setGlobalOptions(
869 static XMLCharEncoding guessCharEncoding(
870 void*
buffer,
int bufLen,
char useXMLEncodingAttribute = 1);
918 char parseClearTag(
void* px,
void* pa);
919 char maybeAddTxT(
void* pa,
XMLCSTR tokenPStr);
920 int ParseXMLElement(
void* pXML);
923 int indexText(
XMLCSTR lpszValue)
const;
924 int indexClear(
XMLCSTR lpszValue)
const;
929 void emptyTheNode(
char force);
932 static int CreateXMLStringR(
1026 static XMLSTR toXMLUnSafe(
1028 static int lengthXMLString(
1069 static int encodeLength(
int inBufLen,
char formatted = 0);
1086 unsigned char* inByteBuf,
unsigned int inByteLen,
1087 char formatted = 0);
1092 static unsigned int decodeSize(
XMLCSTR inString,
XMLError* xe =
nullptr);
1101 unsigned char* decode(
1102 XMLCSTR inString,
int* outByteLen =
nullptr,
1113 static unsigned char decode(
1114 XMLCSTR inString,
unsigned char* outByteBuf,
int inMaxByteOutBuflen,
1120 void alloc(
int newsize);
@ eXMLErrorUnknownCharacterEntity
XMLDLLENTRY XMLCHAR xmltoc(XMLCSTR xmlString, XMLCHAR defautValue=_CXML('\0'))
XMLDLLENTRY void freeXMLString(XMLSTR t)
to free the string allocated inside the "stringDup" function or the "createXMLString" function.
enum XMLElementType etype
This dictates what's the content of the XMLNodeContent.
@ eXMLErrorBase64DecodeBufferTooSmall
@ eXMLErrorUnmatchedEndTag
XMLDLLENTRY XMLSTR stringDup(XMLCSTR source, int cbData=-1)
Duplicate (copy in a new allocated buffer) the source string.
struct XMLNodeContents XMLNodeContents
This structure is given by the function XMLNode::enumContents.
@ eXMLErrorFirstTagNotFound
@ eXMLErrorCannotWriteFile
struct XMLAttribute XMLAttribute
Structure for XML attribute.
static XMLClear emptyXMLClear
static XMLAttribute emptyXMLAttribute
This structure is given by the function XMLNode::enumContents.
@ eXMLErrorBase64DecodeIllegalCharacter
GLuint const GLchar * name
Structure used to obtain error details if the parse fails.
GLsizei GLsizei GLchar * source
XMLDLLENTRY char xmltob(XMLCSTR xmlString, char defautValue=0)
static XMLNode::XMLCharEncoding characterEncoding
XMLError
Enumeration for XML parse errors.
@ eXMLErrorUnexpectedToken
@ eXMLErrorCannotOpenWriteFile
@ eXMLErrorCharConversionError
XMLCharEncoding
childNode with the specified name if (name==nullptr) return the position of the ith childNode
XMLAttribute * pAttribute
static char removeCommentsInMiddleOfText
XMLDLLENTRY double xmltof(XMLCSTR xmlString, double defautValue=.0)
struct XMLNodeDataTag * pParent
XMLElementType
Enumeration used to manage type of data.
@ eXMLErrorUnmatchedEndClearTag
@ eXMLErrorBase64DataSizeIsNotMultipleOf4
static char dropWhiteSpace
@ eXMLErrorMissingEndTagName
XMLDLLENTRY int xmltoi(XMLCSTR xmlString, int defautValue=0)
int XMLElementPosition
XMLElementPosition are not interchangeable with simple indexes.
Structure for XML attribute.
XMLDLLENTRY XMLCSTR xmltoa(XMLCSTR xmlString, XMLCSTR defautValue=_CXML(""))
static char guessWideCharChars
Main Class representing a XML node.
XMLDLLENTRY long xmltol(XMLCSTR xmlString, long defautValue=0)
@ eXMLErrorCharacterCodeAbove255
struct XMLResults XMLResults
Structure used to obtain error details if the parse fails.
struct XMLDLLENTRY XMLNode XMLNode
Main Class representing a XML node.
struct XMLNode::XMLNodeDataTag XMLNodeData
struct XMLClear XMLClear
Structure for XML clear (unformatted) node (usually comments)
@ eXMLErrorBase64DecodeTruncatedData
@ eXMLErrorMissingTagName
Structure for XML clear (unformatted) node (usually comments)
GLubyte GLubyte GLubyte a
Page generated by Doxygen 1.8.17 for MRPT 1.9.9 Git: ad3a9d8ae Tue May 1 23:10:22 2018 -0700 at mié 12 jul 2023 10:03:34 CEST | |