From dba112439cc408d5277af993177c7b93647b4fc0 Mon Sep 17 00:00:00 2001 From: HALX99 Date: Sat, 12 Jan 2019 10:39:19 +0800 Subject: [PATCH 1/2] Fix indent --- src/pugixml.hpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/pugixml.hpp b/src/pugixml.hpp index 759ea48..264a5fd 100644 --- a/src/pugixml.hpp +++ b/src/pugixml.hpp @@ -509,9 +509,9 @@ namespace pugi // Get text object for the current node xml_text text() const; - - // Ensure child, more convinently for config updating - xml_node operator[](const char_t* name); + + // Get child, if not exist, create it, more conveniently for config updating + xml_node operator[](const char_t* name); // Get child, attribute or next/previous sibling with the specified name xml_node child(const char_t* name) const; From 8b2ef66d272c9a075b4e9782ef11b560674fd853 Mon Sep 17 00:00:00 2001 From: HALX99 Date: Sat, 12 Jan 2019 10:43:34 +0800 Subject: [PATCH 2/2] Let compiler without C++11 support happy. --- src/pugixml.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/pugixml.cpp b/src/pugixml.cpp index 42b10ec..34ebac6 100644 --- a/src/pugixml.cpp +++ b/src/pugixml.cpp @@ -5482,13 +5482,13 @@ namespace pugi return (_root && _root->value) ? _root->value + 0 : PUGIXML_TEXT(""); } - PUGI__FN xml_node xml_node::operator[](const char_t* name) - { - if (!_root) return xml_node(); - auto node = this->child(name); - if (node) return node; - return this->append_child(name); - } + PUGI__FN xml_node xml_node::operator[](const char_t* name) + { + if (!_root) return xml_node(); + xml_node n = this->child(name); + if (n) return n; + return this->append_child(name); + } PUGI__FN xml_node xml_node::child(const char_t* name_) const {