From 959291afe69de05aaa7ceeb61b3b0ede7a54bfea Mon Sep 17 00:00:00 2001 From: Florent Le Coz Date: Fri, 22 Nov 2013 20:44:27 +0100 Subject: Set the parent of a node passed to add_child, and return it for conveniance --- src/xmpp/xmpp_stanza.hpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'src/xmpp/xmpp_stanza.hpp') diff --git a/src/xmpp/xmpp_stanza.hpp b/src/xmpp/xmpp_stanza.hpp index 2ce8ce2..ca21ab4 100644 --- a/src/xmpp/xmpp_stanza.hpp +++ b/src/xmpp/xmpp_stanza.hpp @@ -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 -- cgit v1.2.3