Add a template based get/set_property API to PBD::XMLNode
[ardour.git] / libs / pbd / xml++.cc
index dbe6d51e0d302efbbc27737e79e3db5b9b5133a0..95547b15ee2eb4cddde042a660cc2b495d6ff464 100644 (file)
@@ -590,6 +590,23 @@ XMLNode::add_property(const char* name, const long value)
        return add_property(name, str);
 }
 
+bool
+XMLNode::set_property(const char* name, const string& str) {
+       return add_property (name, str);
+}
+
+bool
+XMLNode::get_property(const char* name, std::string& value) const
+{
+       XMLProperty const* const prop = property (name);
+       if (!prop)
+               return false;
+
+       value = prop->value ();
+
+       return true;
+}
+
 void
 XMLNode::remove_property(const string& name)
 {