diff options
-rw-r--r-- | libs/win32/mir_core.lib | bin | 463576 -> 465770 bytes | |||
-rw-r--r-- | libs/win64/mir_core.lib | bin | 468422 -> 470688 bytes | |||
-rw-r--r-- | src/mir_core/src/mir_core.def | 9 | ||||
-rw-r--r-- | src/mir_core/src/mir_core64.def | 9 | ||||
-rw-r--r-- | src/mir_core/src/tinyxml2.cpp | 49 | ||||
-rw-r--r-- | src/mir_core/src/tinyxml2.h | 31 |
6 files changed, 77 insertions, 21 deletions
diff --git a/libs/win32/mir_core.lib b/libs/win32/mir_core.lib Binary files differindex 2130e6587f..edf9bb9311 100644 --- a/libs/win32/mir_core.lib +++ b/libs/win32/mir_core.lib diff --git a/libs/win64/mir_core.lib b/libs/win64/mir_core.lib Binary files differindex 6423be6390..992a68bcda 100644 --- a/libs/win64/mir_core.lib +++ b/libs/win64/mir_core.lib diff --git a/src/mir_core/src/mir_core.def b/src/mir_core/src/mir_core.def index b9a61b6e00..50e1c5a66d 100644 --- a/src/mir_core/src/mir_core.def +++ b/src/mir_core/src/mir_core.def @@ -1186,7 +1186,7 @@ db_event_edit @1268 ?LinkEndChild@XMLNode@tinyxml2@@QAEPAV12@PAV12@@Z @1401 NONAME
?LoadFile@XMLDocument@tinyxml2@@QAE?AW4XMLError@2@PAU_iobuf@@@Z @1402 NONAME
?LoadFile@XMLDocument@tinyxml2@@QAE?AW4XMLError@2@PBD@Z @1403 NONAME
-?MarkInUse@XMLDocument@tinyxml2@@QAEXPAVXMLNode@2@@Z @1404 NONAME
+?MarkInUse@XMLDocument@tinyxml2@@QAEXQBVXMLNode@2@@Z @1404 NONAME
?Name@XMLAttribute@tinyxml2@@QBEPBDXZ @1405 NONAME
?Name@XMLElement@tinyxml2@@QBEPBDXZ @1406 NONAME
?NewComment@XMLDocument@tinyxml2@@QAEPAVXMLComment@2@PBD@Z @1407 NONAME
@@ -1329,7 +1329,7 @@ db_event_edit @1268 ?ShallowEqual@XMLElement@tinyxml2@@UBE_NPBVXMLNode@2@@Z @1544 NONAME
?ShallowEqual@XMLText@tinyxml2@@UBE_NPBVXMLNode@2@@Z @1545 NONAME
?ShallowEqual@XMLUnknown@tinyxml2@@UBE_NPBVXMLNode@2@@Z @1546 NONAME
-?SkipWhiteSpace@XMLUtil@tinyxml2@@SAPADPADPAH@Z @1547 NONAME
+?SkipWhiteSpace@XMLUtil@tinyxml2@@SAPADQADPAH@Z @1547 NONAME
?SkipWhiteSpace@XMLUtil@tinyxml2@@SAPBDPBDPAH@Z @1548 NONAME
?StringEqual@XMLUtil@tinyxml2@@SA_NPBD0H@Z @1549 NONAME
?ToBool@XMLUtil@tinyxml2@@SA_NPBDPA_N@Z @1550 NONAME
@@ -1459,3 +1459,8 @@ XmlGetChildText @1645 ?Unlock@mir_cs@@QAEXXZ @1674 NONAME
?StartSafe@CTimer@@QAEXH@Z @1675 NONAME
?StopSafe@CTimer@@QAEXXZ @1676 NONAME
+?InsertNewChildElement@XMLElement@tinyxml2@@QAEPAV12@PBD@Z @1677 NONAME
+?InsertNewComment@XMLElement@tinyxml2@@QAEPAVXMLComment@2@PBD@Z @1678 NONAME
+?InsertNewDeclaration@XMLElement@tinyxml2@@QAEPAVXMLDeclaration@2@PBD@Z @1679 NONAME
+?InsertNewText@XMLElement@tinyxml2@@QAEPAVXMLText@2@PBD@Z @1680 NONAME
+?InsertNewUnknown@XMLElement@tinyxml2@@QAEPAVXMLUnknown@2@PBD@Z @1681 NONAME
diff --git a/src/mir_core/src/mir_core64.def b/src/mir_core/src/mir_core64.def index 4c3168f789..298ed29c9c 100644 --- a/src/mir_core/src/mir_core64.def +++ b/src/mir_core/src/mir_core64.def @@ -1186,7 +1186,7 @@ db_event_edit @1268 ?LinkEndChild@XMLNode@tinyxml2@@QEAAPEAV12@PEAV12@@Z @1401 NONAME
?LoadFile@XMLDocument@tinyxml2@@QEAA?AW4XMLError@2@PEAU_iobuf@@@Z @1402 NONAME
?LoadFile@XMLDocument@tinyxml2@@QEAA?AW4XMLError@2@PEBD@Z @1403 NONAME
-?MarkInUse@XMLDocument@tinyxml2@@QEAAXPEAVXMLNode@2@@Z @1404 NONAME
+?MarkInUse@XMLDocument@tinyxml2@@QEAAXQEBVXMLNode@2@@Z @1404 NONAME
?Name@XMLAttribute@tinyxml2@@QEBAPEBDXZ @1405 NONAME
?Name@XMLElement@tinyxml2@@QEBAPEBDXZ @1406 NONAME
?NewComment@XMLDocument@tinyxml2@@QEAAPEAVXMLComment@2@PEBD@Z @1407 NONAME
@@ -1329,7 +1329,7 @@ db_event_edit @1268 ?ShallowEqual@XMLElement@tinyxml2@@UEBA_NPEBVXMLNode@2@@Z @1544 NONAME
?ShallowEqual@XMLText@tinyxml2@@UEBA_NPEBVXMLNode@2@@Z @1545 NONAME
?ShallowEqual@XMLUnknown@tinyxml2@@UEBA_NPEBVXMLNode@2@@Z @1546 NONAME
-?SkipWhiteSpace@XMLUtil@tinyxml2@@SAPEADPEADPEAH@Z @1547 NONAME
+?SkipWhiteSpace@XMLUtil@tinyxml2@@SAPEADQEADPEAH@Z @1547 NONAME
?SkipWhiteSpace@XMLUtil@tinyxml2@@SAPEBDPEBDPEAH@Z @1548 NONAME
?StringEqual@XMLUtil@tinyxml2@@SA_NPEBD0H@Z @1549 NONAME
?ToBool@XMLUtil@tinyxml2@@SA_NPEBDPEA_N@Z @1550 NONAME
@@ -1459,3 +1459,8 @@ XmlGetChildText @1645 ?Unlock@mir_cs@@QEAAXXZ @1674 NONAME
?StartSafe@CTimer@@QEAAXH@Z @1675 NONAME
?StopSafe@CTimer@@QEAAXXZ @1676 NONAME
+?InsertNewChildElement@XMLElement@tinyxml2@@QEAAPEAV12@PEBD@Z @1677 NONAME
+?InsertNewComment@XMLElement@tinyxml2@@QEAAPEAVXMLComment@2@PEBD@Z @1678 NONAME
+?InsertNewDeclaration@XMLElement@tinyxml2@@QEAAPEAVXMLDeclaration@2@PEBD@Z @1679 NONAME
+?InsertNewText@XMLElement@tinyxml2@@QEAAPEAVXMLText@2@PEBD@Z @1680 NONAME
+?InsertNewUnknown@XMLElement@tinyxml2@@QEAAPEAVXMLUnknown@2@PEBD@Z @1681 NONAME
diff --git a/src/mir_core/src/tinyxml2.cpp b/src/mir_core/src/tinyxml2.cpp index 8bc8dd03c2..b4ece2f203 100644 --- a/src/mir_core/src/tinyxml2.cpp +++ b/src/mir_core/src/tinyxml2.cpp @@ -617,17 +617,17 @@ bool XMLUtil::ToBool( const char* str, bool* value ) *value = (ival==0) ? false : true; return true; } - static const char* szTRUE[] = { "true", "True", "TRUE", 0 }; - static const char* szFALSE[] = { "false", "False", "FALSE", 0 }; + static const char* TRUE_VALS[] = { "true", "True", "TRUE", 0 }; + static const char* FALSE_VALS[] = { "false", "False", "FALSE", 0 }; - for (int i = 0; szTRUE[i]; ++i) { - if (StringEqual(str, szTRUE[i])) { + for (int i = 0; TRUE_VALS[i]; ++i) { + if (StringEqual(str, TRUE_VALS[i])) { *value = true; return true; } } - for (int i = 0; szFALSE[i]; ++i) { - if (StringEqual(str, szFALSE[i])) { + for (int i = 0; FALSE_VALS[i]; ++i) { + if (StringEqual(str, FALSE_VALS[i])) { *value = false; return true; } @@ -1975,6 +1975,39 @@ XMLAttribute* XMLElement::CreateAttribute() return attrib; } + +XMLElement* XMLElement::InsertNewChildElement(const char* name) +{ + XMLElement* node = _document->NewElement(name); + return InsertEndChild(node) ? node : 0; +} + +XMLComment* XMLElement::InsertNewComment(const char* comment) +{ + XMLComment* node = _document->NewComment(comment); + return InsertEndChild(node) ? node : 0; +} + +XMLText* XMLElement::InsertNewText(const char* text) +{ + XMLText* node = _document->NewText(text); + return InsertEndChild(node) ? node : 0; +} + +XMLDeclaration* XMLElement::InsertNewDeclaration(const char* text) +{ + XMLDeclaration* node = _document->NewDeclaration(text); + return InsertEndChild(node) ? node : 0; +} + +XMLUnknown* XMLElement::InsertNewUnknown(const char* text) +{ + XMLUnknown* node = _document->NewUnknown(text); + return InsertEndChild(node) ? node : 0; +} + + + // // <ele></ele> // <ele>foo<b>bar</b></ele> @@ -2115,7 +2148,7 @@ XMLDocument::~XMLDocument() } -void XMLDocument::MarkInUse(XMLNode* node) +void XMLDocument::MarkInUse(const XMLNode* const node) { TIXMLASSERT(node); TIXMLASSERT(node->_parent == 0); @@ -2650,8 +2683,6 @@ void XMLPrinter::OpenElement( const char* name, bool compactMode ) if ( _textDepth < 0 && !_firstElement && !compactMode ) { Putc( '\n' ); - } - if ( !compactMode ) { PrintSpace( _depth ); } diff --git a/src/mir_core/src/tinyxml2.h b/src/mir_core/src/tinyxml2.h index 44642078e9..7d5a151e67 100644 --- a/src/mir_core/src/tinyxml2.h +++ b/src/mir_core/src/tinyxml2.h @@ -98,12 +98,12 @@ distribution. /* Versioning, past 1.0.14: http://semver.org/ */ -static const int TIXML2_MAJOR_VERSION = 7; -static const int TIXML2_MINOR_VERSION = 1; +static const int TIXML2_MAJOR_VERSION = 8; +static const int TIXML2_MINOR_VERSION = 0; static const int TIXML2_PATCH_VERSION = 0; -#define TINYXML2_MAJOR_VERSION 7 -#define TINYXML2_MINOR_VERSION 1 +#define TINYXML2_MAJOR_VERSION 8 +#define TINYXML2_MINOR_VERSION 0 #define TINYXML2_PATCH_VERSION 0 // A fixed element depth limit is problematic. There needs to be a @@ -562,7 +562,7 @@ public: TIXMLASSERT( p ); return p; } - static char* SkipWhiteSpace( char* p, int* curLineNumPtr ) { + static char* SkipWhiteSpace( char* const p, int* curLineNumPtr ) { return const_cast<char*>( SkipWhiteSpace( const_cast<const char*>(p), curLineNumPtr ) ); } @@ -600,7 +600,7 @@ public: return strncmp( p, q, nChar ) == 0; } - inline static bool IsUTF8Continuation( char p ) { + inline static bool IsUTF8Continuation( const char p ) { return ( p & 0x80 ) != 0; } @@ -1647,7 +1647,22 @@ public: /// See QueryIntText() double DoubleText(double defaultValue = 0) const; /// See QueryIntText() - float FloatText(float defaultValue = 0) const; + float FloatText(float defaultValue = 0) const; + + /** + Convenience method to create a new XMLElement and add it as last (right) + child of this node. Returns the created and inserted element. + */ + XMLElement* InsertNewChildElement(const char* name); + /// See InsertNewChildElement() + XMLComment* InsertNewComment(const char* comment); + /// See InsertNewChildElement() + XMLText* InsertNewText(const char* text); + /// See InsertNewChildElement() + XMLDeclaration* InsertNewDeclaration(const char* text); + /// See InsertNewChildElement() + XMLUnknown* InsertNewUnknown(const char* text); + // internal: enum ElementClosingType { @@ -1904,7 +1919,7 @@ public: char* Identify( char* p, XMLNode** node ); // internal - void MarkInUse(XMLNode*); + void MarkInUse(const XMLNode* const); virtual XMLNode* ShallowClone( XMLDocument* /*document*/ ) const { return 0; |