From 9ac0d3a5766494c9c0c2074c4a21542eea195a29 Mon Sep 17 00:00:00 2001 From: Florent Le Coz Date: Tue, 22 Dec 2015 21:37:29 +0100 Subject: A few cleanups, and make a few things more modern --- louloulibs/xmpp/xmpp_stanza.hpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'louloulibs/xmpp/xmpp_stanza.hpp') diff --git a/louloulibs/xmpp/xmpp_stanza.hpp b/louloulibs/xmpp/xmpp_stanza.hpp index b1ba54a..bdc937f 100644 --- a/louloulibs/xmpp/xmpp_stanza.hpp +++ b/louloulibs/xmpp/xmpp_stanza.hpp @@ -96,6 +96,7 @@ public: XmlNode* get_last_child() const; XmlNode* get_parent() const; void set_name(const std::string& name); + void set_name(std::string&& name); const std::string get_name() const; /** * Serialize the stanza into a string @@ -110,7 +111,7 @@ public: * Gets the value for the given attribute, returns an empty string if the * node as no such attribute. */ - const std::string get_tag(const std::string& name) const; + const std::string& get_tag(const std::string& name) const; /** * Remove the attribute of the node. Does nothing if that attribute is not * present. Returns true if the tag was removed, false if it was absent. @@ -133,13 +134,13 @@ private: XmlNode& operator=(XmlNode&&) = delete; }; +std::ostream& operator<<(std::ostream& os, const XmlNode& node); + /** * An XMPP stanza is just an XML node of level 2 in the XMPP document (the * level 1 ones are the , and the ones above 2 are just the * content of the stanzas) */ -typedef XmlNode Stanza; - -std::ostream& operator<<(std::ostream& os, const XmlNode& node); +using Stanza = XmlNode; #endif // XMPP_STANZA_INCLUDED -- cgit v1.2.3