A few cleanups, and make a few things more modern

This commit is contained in:
Florent Le Coz
2015-12-23 11:05:55 +01:00
parent 9167cdf126
commit 9ac0d3a576
5 changed files with 23 additions and 22 deletions
+8 -2
View File
@@ -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;
}
}