Do not use exceptions for missing tags, improvement in code simplicity

This commit is contained in:
Florent Le Coz
2014-04-11 23:06:13 +02:00
parent a20c60a0d8
commit f00f5c3ffb
4 changed files with 58 additions and 83 deletions
+2 -2
View File
@@ -216,7 +216,7 @@ bool XmlNode::has_children() const
return !this->children.empty();
}
const std::string& XmlNode::operator[](const std::string& name) const
const std::string XmlNode::get_tag(const std::string& name) const
{
try
{
@@ -225,7 +225,7 @@ const std::string& XmlNode::operator[](const std::string& name) const
}
catch (const std::out_of_range& e)
{
throw AttributeNotFound();
return "";
}
}