From a1e08d59a3a7c4b4831216afa755c4e0579b2ed7 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Thu, 14 Feb 2019 19:49:00 +0300 Subject: added operator[] for XMLConstHandle & XMLHandle, making Xpath much shorter --- src/mir_core/src/mir_core.def | 2 ++ src/mir_core/src/mir_core64.def | 2 ++ src/mir_core/src/tinyxml2.h | 8 ++++++++ 3 files changed, 12 insertions(+) (limited to 'src') 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 ); } -- cgit v1.2.3