if (n.size() > 1) {
throw cxml::Error ("duplicate XML tag " + name);
} else if (n.empty ()) {
- return shared_ptr<cxml::Node> ();
+ return {};
}
return n.front ();
}
if (nodes.empty ()) {
- return optional<string> ();
+ return {};
}
return nodes.front()->content();
{
auto const s = optional_string_child (c);
if (!s) {
- return optional<bool> ();
+ return {};
}
return (s.get() == "1" || s.get() == "yes" || s.get() == "True");
{
auto e = dynamic_cast<const xmlpp::Element *> (_node);
if (!e) {
- return optional<string> ();
+ return {};
}
auto a = e->get_attribute (name);
if (!a) {
- return optional<string> ();
+ return {};
}
return string (a->get_value ());
{
auto s = optional_string_attribute (name);
if (!s) {
- return optional<bool> ();
+ return {};
}
return (s.get() == "1" || s.get() == "yes");