Set the parent of a node passed to add_child, and return it for conveniance

This commit is contained in:
Florent Le Coz
2013-11-27 00:37:23 +01:00
parent 12a18ca748
commit 959291afe6
2 changed files with 14 additions and 5 deletions
+9 -2
View File
@@ -77,8 +77,15 @@ public:
* Get a pointer to the first child element with that name
*/
XmlNode* get_child(const std::string& name) const;
void add_child(XmlNode* child);
void add_child(XmlNode&& child);
/**
* Add a node child to this node. Assign this node to the child’s parent.
* Returns a pointer to the newly added child.
*/
XmlNode* add_child(XmlNode* child);
XmlNode* add_child(XmlNode&& child);
/**
* Returns the last of the children
*/
XmlNode* get_last_child() const;
/**
* Mark this node as closed, nothing else