commit
baac8d70b1
@ -5482,13 +5482,13 @@ namespace pugi
|
|||||||
return (_root && _root->value) ? _root->value + 0 : PUGIXML_TEXT("");
|
return (_root && _root->value) ? _root->value + 0 : PUGIXML_TEXT("");
|
||||||
}
|
}
|
||||||
|
|
||||||
PUGI__FN xml_node xml_node::operator[](const char_t* name)
|
PUGI__FN xml_node xml_node::operator[](const char_t* name)
|
||||||
{
|
{
|
||||||
if (!_root) return xml_node();
|
if (!_root) return xml_node();
|
||||||
auto node = this->child(name);
|
xml_node n = this->child(name);
|
||||||
if (node) return node;
|
if (n) return n;
|
||||||
return this->append_child(name);
|
return this->append_child(name);
|
||||||
}
|
}
|
||||||
|
|
||||||
PUGI__FN xml_node xml_node::child(const char_t* name_) const
|
PUGI__FN xml_node xml_node::child(const char_t* name_) const
|
||||||
{
|
{
|
||||||
|
|||||||
@ -509,9 +509,9 @@ namespace pugi
|
|||||||
|
|
||||||
// Get text object for the current node
|
// Get text object for the current node
|
||||||
xml_text text() const;
|
xml_text text() const;
|
||||||
|
|
||||||
// Ensure child, more convinently for config updating
|
// Get child, if not exist, create it, more conveniently for config updating
|
||||||
xml_node operator[](const char_t* name);
|
xml_node operator[](const char_t* name);
|
||||||
|
|
||||||
// Get child, attribute or next/previous sibling with the specified name
|
// Get child, attribute or next/previous sibling with the specified name
|
||||||
xml_node child(const char_t* name) const;
|
xml_node child(const char_t* name) const;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user