44a45
> * Copyright (c) 2010-2013 Advanced Micro Devices, Inc.
163c164
< // to have 'mbsrtowcs' for WIDECHAR version
---
> // to have 'mbsrtowcs' for WIDECHAR version
169,172c170,173
< #define _CXML(c) L ## c
< #define XMLCSTR const wchar_t *
< #define XMLSTR wchar_t *
< #define XMLCHAR wchar_t
---
> #define _CXML(c) L ## c
> #define XMLCSTR const wchar_t *
> #define XMLSTR wchar_t *
> #define XMLCHAR wchar_t
174,177c175,178
< #define _CXML(c) c
< #define XMLCSTR const char *
< #define XMLSTR char *
< #define XMLCHAR char
---
> #define _CXML(c) c
> #define XMLCSTR const char *
> #define XMLSTR char *
> #define XMLCHAR char
180c181
< #define FALSE 0
---
> #define FALSE 0
183c184
< #define TRUE 1
---
> #define TRUE 1
188,189c189
< typedef enum XMLError
< {
---
> typedef enum XMLError {
216,222c216,221
< typedef enum XMLElementType
< {
< eNodeChild=0,
< eNodeAttribute=1,
< eNodeText=2,
< eNodeClear=3,
< eNodeNULL=4
---
> typedef enum XMLElementType {
> eNodeChild = 0,
> eNodeAttribute = 1,
> eNodeText = 2,
> eNodeClear = 3,
> eNodeNULL = 4
226,227c225
< typedef struct XMLResults
< {
---
> typedef struct XMLResults {
229c227,228
< int nLine,nColumn;
---
> int nLine;
> int nColumn;
234c233,235
< XMLCSTR lpszValue; XMLCSTR lpszOpenTag; XMLCSTR lpszCloseTag;
---
> XMLCSTR lpszValue;
> XMLCSTR lpszOpenTag;
> XMLCSTR lpszCloseTag;
239c240,241
< XMLCSTR lpszName; XMLCSTR lpszValue;
---
> XMLCSTR lpszName;
> XMLCSTR lpszValue;
259,261c261,262
< typedef struct XMLDLLENTRY XMLNode
< {
< private:
---
> typedef struct XMLDLLENTRY XMLNode {
> private:
270c271
< public:
---
> public:
278c279,280
< static XMLNode parseString (XMLCSTR lpXMLString, XMLCSTR tag=NULL, XMLResults *pResults=NULL);
---
> static XMLNode parseString(XMLCSTR lpXMLString, XMLCSTR tag = NULL,
> XMLResults *pResults = NULL);
291c293,294
< static XMLNode parseFile (XMLCSTR filename, XMLCSTR tag=NULL, XMLResults *pResults=NULL);
---
> static XMLNode parseFile(XMLCSTR filename, XMLCSTR tag = NULL,
> XMLResults *pResults = NULL);
304c307
< static XMLNode openFileHelper(XMLCSTR filename, XMLCSTR tag=NULL);
---
> static XMLNode openFileHelper(XMLCSTR filename, XMLCSTR tag = NULL);
325c328
< XMLSTR createXMLString(int nFormat=1, int *pnSize=NULL) const;
---
> XMLSTR createXMLString(int nFormat = 1, int *pnSize = NULL) const;
333,334c336,337
< const char *encoding=NULL,
< char nFormat=1) const;
---
> const char *encoding = NULL,
> char nFormat = 1) const;
351a355
> XMLNode* getChildNodePtr(XMLCSTR name, int *j) const;
357c361
< ///< return the first child node with specific path
---
> ///< return the first child node with specific path
359c363
< ///< return the first child node with specific path.
---
> ///< return the first child node with specific path.
421,422c425,426
< XMLAttribute *updateAttribute(XMLCSTR lpszNewValue, XMLCSTR lpszNewName=NULL,int i=0); ///< if the attribute to update is missing, a new one will be added
< XMLAttribute *updateAttribute(XMLCSTR lpszNewValue, XMLCSTR lpszNewName,XMLCSTR lpszOldName);///< set lpszNewName=NULL if you don't want to change the name of the attribute if the attribute to update is missing, a new one will be added
---
> XMLAttribute *updateAttribute(XMLCSTR lpszNewValue, XMLCSTR lpszNewName=NULL, int i=0); ///< if the attribute to update is missing, a new one will be added
> XMLAttribute *updateAttribute(XMLCSTR lpszNewValue, XMLCSTR lpszNewName, XMLCSTR lpszOldName);///< set lpszNewName=NULL if you don't want to change the name of the attribute if the attribute to update is missing, a new one will be added
426c430
< XMLClear *updateClear(XMLClear *newP,XMLClear *oldP); ///< if the clearTag to update is missing, a new one will be added
---
> XMLClear *updateClear(XMLClear *newP, XMLClear *oldP); ///< if the clearTag to update is missing, a new one will be added
485,486c489,490
< XMLAttribute *updateAttribute_WOSD(XMLSTR lpszNewValue, XMLSTR lpszNewName=NULL,int i=0); ///< if the attribute to update is missing, a new one will be added
< XMLAttribute *updateAttribute_WOSD(XMLSTR lpszNewValue, XMLSTR lpszNewName,XMLCSTR lpszOldName); ///< set lpszNewName=NULL if you don't want to change the name of the attribute if the attribute to update is missing, a new one will be added
---
> XMLAttribute *updateAttribute_WOSD(XMLSTR lpszNewValue, XMLSTR lpszNewName=NULL, int i=0); ///< if the attribute to update is missing, a new one will be added
> XMLAttribute *updateAttribute_WOSD(XMLSTR lpszNewValue, XMLSTR lpszNewName, XMLCSTR lpszOldName); ///< set lpszNewName=NULL if you don't want to change the name of the attribute if the attribute to update is missing, a new one will be added
490c494
< XMLClear *updateClear_WOSD(XMLClear *newP,XMLClear *oldP); ///< if the clearTag to update is missing, a new one will be added
---
> XMLClear *updateClear_WOSD(XMLClear *newP, XMLClear *oldP); ///< if the clearTag to update is missing, a new one will be added
511,519c515,522
< typedef enum XMLCharEncoding
< {
< char_encoding_error=0,
< char_encoding_UTF8=1,
< char_encoding_legacy=2,
< char_encoding_ShiftJIS=3,
< char_encoding_GB2312=4,
< char_encoding_Big5=5,
< char_encoding_GBK=6 // this is actually the same as Big5
---
> typedef enum XMLCharEncoding {
> char_encoding_error = 0,
> char_encoding_UTF8 = 1,
> char_encoding_legacy = 2,
> char_encoding_ShiftJIS = 3,
> char_encoding_GB2312 = 4,
> char_encoding_Big5 = 5,
> char_encoding_GBK = 6 // this is actually the same as Big5
592,593c595,596
< private:
< // these are functions and structures used internally by the XMLNode class (don't bother about them):
---
> private:
> // these are functions and structures used internally by the XMLNode class (don't bother about them):
595,611c598,613
< typedef struct XMLNodeDataTag // to allow shallow copy and "intelligent/smart" pointers (automatic delete):
< {
< XMLCSTR lpszName; // Element name (=NULL if root)
< int nChild, // Number of child nodes
< nText, // Number of text fields
< nClear, // Number of Clear fields (comments)
< nAttribute; // Number of attributes
< char isDeclaration; // Whether node is an XML declaration - '<?xml ?>'
< struct XMLNodeDataTag *pParent; // Pointer to parent element (=NULL if root)
< XMLNode *pChild; // Array of child nodes
< XMLCSTR *pText; // Array of text fields
< XMLClear *pClear; // Array of clear fields
< XMLAttribute *pAttribute; // Array of attributes
< int *pOrder; // order of the child_nodes,text_fields,clear_fields
< int ref_count; // for garbage collection (smart pointers)
< } XMLNodeData;
< XMLNodeData *d;
---
> typedef struct XMLNodeDataTag { // to allow shallow copy and "intelligent/smart" pointers (automatic delete):
> XMLCSTR lpszName; // Element name (=NULL if root)
> int nChild, // Number of child nodes
> nText, // Number of text fields
> nClear, // Number of Clear fields (comments)
> nAttribute; // Number of attributes
> char isDeclaration; // Whether node is an XML declaration - '<?xml ?>'
> struct XMLNodeDataTag *pParent; // Pointer to parent element (=NULL if root)
> XMLNode *pChild; // Array of child nodes
> XMLCSTR *pText; // Array of text fields
> XMLClear *pClear; // Array of clear fields
> XMLAttribute *pAttribute; // Array of attributes
> int *pOrder; // order of the child_nodes,text_fields,clear_fields
> int ref_count; // for garbage collection (smart pointers)
> } XMLNodeData;
> XMLNodeData *d;
613,628c615,630
< char parseClearTag(void *px, void *pa);
< char maybeAddTxT(void *pa, XMLCSTR tokenPStr);
< int ParseXMLElement(void *pXML);
< void *addToOrder(int memInc, int *_pos, int nc, void *p, int size, XMLElementType xtype);
< int indexText(XMLCSTR lpszValue) const;
< int indexClear(XMLCSTR lpszValue) const;
< XMLNode addChild_priv(int,XMLSTR,char,int);
< XMLAttribute *addAttribute_priv(int,XMLSTR,XMLSTR);
< XMLCSTR addText_priv(int,XMLSTR,int);
< XMLClear *addClear_priv(int,XMLSTR,XMLCSTR,XMLCSTR,int);
< void emptyTheNode(char force);
< static inline XMLElementPosition findPosition(XMLNodeData *d, int index, XMLElementType xtype);
< static int CreateXMLStringR(XMLNodeData *pEntry, XMLSTR lpszMarker, int nFormat);
< static int removeOrderElement(XMLNodeData *d, XMLElementType t, int index);
< static void exactMemory(XMLNodeData *d);
< static int detachFromParent(XMLNodeData *d);
---
> char parseClearTag(void *px, void *pa);
> char maybeAddTxT(void *pa, XMLCSTR tokenPStr);
> int ParseXMLElement(void *pXML);
> void *addToOrder(int memInc, int *_pos, int nc, void *p, int size, XMLElementType xtype);
> int indexText(XMLCSTR lpszValue) const;
> int indexClear(XMLCSTR lpszValue) const;
> XMLNode addChild_priv(int, XMLSTR, char, int);
> XMLAttribute *addAttribute_priv(int, XMLSTR, XMLSTR);
> XMLCSTR addText_priv(int, XMLSTR, int);
> XMLClear *addClear_priv(int, XMLSTR, XMLCSTR, XMLCSTR, int);
> void emptyTheNode(char force);
> static inline XMLElementPosition findPosition(XMLNodeData *d, int index, XMLElementType xtype);
> static int CreateXMLStringR(XMLNodeData *pEntry, XMLSTR lpszMarker, int nFormat);
> static int removeOrderElement(XMLNodeData *d, XMLElementType t, int index);
> static void exactMemory(XMLNodeData *d);
> static int detachFromParent(XMLNodeData *d);
632,633c634
< typedef struct XMLNodeContents
< {
---
> typedef struct XMLNodeContents {
667,672c668,673
< XMLDLLENTRY char xmltob(XMLCSTR xmlString,char defautValue=0);
< XMLDLLENTRY int xmltoi(XMLCSTR xmlString,int defautValue=0);
< XMLDLLENTRY long xmltol(XMLCSTR xmlString,long defautValue=0);
< XMLDLLENTRY double xmltof(XMLCSTR xmlString,double defautValue=.0);
< XMLDLLENTRY XMLCSTR xmltoa(XMLCSTR xmlString,XMLCSTR defautValue=_CXML(""));
< XMLDLLENTRY XMLCHAR xmltoc(XMLCSTR xmlString,XMLCHAR defautValue=_CXML('\0'));
---
> XMLDLLENTRY char xmltob(XMLCSTR xmlString, char defautValue=0);
> XMLDLLENTRY int xmltoi(XMLCSTR xmlString, int defautValue=0);
> XMLDLLENTRY long xmltol(XMLCSTR xmlString, long defautValue=0);
> XMLDLLENTRY double xmltof(XMLCSTR xmlString, double defautValue=.0);
> XMLDLLENTRY XMLCSTR xmltoa(XMLCSTR xmlString, XMLCSTR defautValue=_CXML(""));
> XMLDLLENTRY XMLCHAR xmltoc(XMLCSTR xmlString, XMLCHAR defautValue=_CXML('\0'));
688,689c689
< typedef struct XMLDLLENTRY ToXMLStringTool
< {
---
> typedef struct XMLDLLENTRY ToXMLStringTool {
691c691
< ToXMLStringTool(): buf(NULL),buflen(0){}
---
> ToXMLStringTool(): buf(NULL), buflen(0){}
721,722c721
< typedef struct XMLDLLENTRY XMLParserBase64Tool
< {
---
> typedef struct XMLDLLENTRY XMLParserBase64Tool {
724c723
< XMLParserBase64Tool(): buf(NULL),buflen(0){}
---
> XMLParserBase64Tool(): buf(NULL), buflen(0){}