summaryrefslogtreecommitdiff
path: root/louloulibs/xmpp/xmpp_stanza.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'louloulibs/xmpp/xmpp_stanza.cpp')
-rw-r--r--louloulibs/xmpp/xmpp_stanza.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/louloulibs/xmpp/xmpp_stanza.cpp b/louloulibs/xmpp/xmpp_stanza.cpp
index d1c2e0f..f247436 100644
--- a/louloulibs/xmpp/xmpp_stanza.cpp
+++ b/louloulibs/xmpp/xmpp_stanza.cpp
@@ -199,6 +199,11 @@ void XmlNode::set_name(const std::string& name)
this->name = name;
}
+void XmlNode::set_name(std::string&& name)
+{
+ this->name = std::move(name);
+}
+
const std::string XmlNode::get_name() const
{
return this->name;
@@ -228,7 +233,7 @@ bool XmlNode::has_children() const
return !this->children.empty();
}
-const std::string XmlNode::get_tag(const std::string& name) const
+const std::string& XmlNode::get_tag(const std::string& name) const
{
try
{
@@ -237,7 +242,8 @@ const std::string XmlNode::get_tag(const std::string& name) const
}
catch (const std::out_of_range& e)
{
- return "";
+ static const std::string def{};
+ return def;
}
}