Modify to override assignment operator

This operator assigns new values to the xml_node, replacing its current
content.

Signed-off-by: Jihun Ahn <jhun.ahnn@gmail.com>
This commit is contained in:
Jihun Ahn 2020-03-15 00:46:03 +09:00
parent 39055a06a3
commit 6d646262c6
2 changed files with 9 additions and 0 deletions

View File

@ -5501,6 +5501,14 @@ namespace pugi
return append_child(name_);
}
PUGI__FN xml_node& xml_node::operator=(const char_t* rhs)
{
xml_node node = append_child(node_pcdata);
node.set_value(rhs);
return *this;
}
PUGI__FN bool xml_node::empty() const
{
return !_root;

View File

@ -489,6 +489,7 @@ namespace pugi
bool operator>=(const xml_node& r) const;
xml_node operator[](const char_t* name_);
xml_node& operator=(const char_t* rhs);
// Check if node is empty.
bool empty() const;