diff options
author | George Hazan <ghazan@miranda.im> | 2019-02-14 19:49:00 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2019-02-14 19:49:00 +0300 |
commit | a1e08d59a3a7c4b4831216afa755c4e0579b2ed7 (patch) | |
tree | 0de8c7596fb27e0c7856011412beef9383ac87c2 /src | |
parent | 4fd7e4b563949b0f82d4e5fc81727af2de38da31 (diff) |
added operator[] for XMLConstHandle & XMLHandle, making Xpath much shorter
Diffstat (limited to 'src')
-rw-r--r-- | src/mir_core/src/mir_core.def | 2 | ||||
-rw-r--r-- | src/mir_core/src/mir_core64.def | 2 | ||||
-rw-r--r-- | src/mir_core/src/tinyxml2.h | 8 |
3 files changed, 12 insertions, 0 deletions
diff --git a/src/mir_core/src/mir_core.def b/src/mir_core/src/mir_core.def index 5a39a144d7..112500b679 100644 --- a/src/mir_core/src/mir_core.def +++ b/src/mir_core/src/mir_core.def @@ -1413,3 +1413,5 @@ db_event_edit @1268 ?SetText@XMLElement@tinyxml2@@QAEXPB_W@Z @1626 NONAME
?SetAttribute@XMLAttribute@tinyxml2@@QAEXPB_W@Z @1627 NONAME
?SetAttribute@XMLElement@tinyxml2@@QAEXPBDPB_W@Z @1628 NONAME
+??AXMLConstHandle@tinyxml2@@QBE?BV01@PBD@Z @1629 NONAME
+??AXMLHandle@tinyxml2@@QAE?AV01@PBD@Z @1630 NONAME
diff --git a/src/mir_core/src/mir_core64.def b/src/mir_core/src/mir_core64.def index 8df59970ba..eac6cc4c13 100644 --- a/src/mir_core/src/mir_core64.def +++ b/src/mir_core/src/mir_core64.def @@ -1413,3 +1413,5 @@ db_event_edit @1268 ?SetText@XMLElement@tinyxml2@@QEAAXPEB_W@Z @1626 NONAME
?SetAttribute@XMLAttribute@tinyxml2@@QEAAXPEB_W@Z @1627 NONAME
?SetAttribute@XMLElement@tinyxml2@@QEAAXPEBDPEB_W@Z @1628 NONAME
+??AXMLConstHandle@tinyxml2@@QEBA?BV01@PEBD@Z @1629 NONAME
+??AXMLHandle@tinyxml2@@QEAA?AV01@PEBD@Z @1630 NONAME
diff --git a/src/mir_core/src/tinyxml2.h b/src/mir_core/src/tinyxml2.h index 7cdd917a2d..168f825d1a 100644 --- a/src/mir_core/src/tinyxml2.h +++ b/src/mir_core/src/tinyxml2.h @@ -2012,6 +2012,10 @@ public: return *this; } + XMLHandle operator[]( const char* name ) { + return XMLHandle( _node ? _node->FirstChildElement( name ) : 0 ); + } + /// Get the first child of this handle. XMLHandle FirstChild() { return XMLHandle( _node ? _node->FirstChild() : 0 ); @@ -2090,6 +2094,10 @@ public: return *this; } + const XMLConstHandle operator[]( const char* name ) const { + return XMLConstHandle( _node ? _node->FirstChildElement( name ) : 0 ); + } + const XMLConstHandle FirstChild() const { return XMLConstHandle( _node ? _node->FirstChild() : 0 ); } |