From 6e467153a087497a21c8a584820da00241bc42cf Mon Sep 17 00:00:00 2001 From: Tim Mayberry Date: Tue, 30 Aug 2016 18:59:05 +1000 Subject: Remove unused XMLNode::add_property methods These are now unused and functionality is replaced by XMLNode::set_property set_property is a better name as a node can only have properties with unique names and the property will be set or reset(if it already exists). Changing the name also makes it easier to transition and test the new API. --- libs/pbd/pbd/xml++.h | 4 ---- libs/pbd/xml++.cc | 28 ++++------------------------ 2 files changed, 4 insertions(+), 28 deletions(-) (limited to 'libs') diff --git a/libs/pbd/pbd/xml++.h b/libs/pbd/pbd/xml++.h index 2a18d9deb7..476e367383 100644 --- a/libs/pbd/pbd/xml++.h +++ b/libs/pbd/pbd/xml++.h @@ -141,10 +141,6 @@ public: bool has_property_with_value (const std::string&, const std::string&) const; - XMLProperty* add_property(const char* name, const std::string& value); - XMLProperty* add_property(const char* name, const char* value = ""); - XMLProperty* add_property(const char* name, const long value); - bool set_property (const char* name, const std::string& value); bool set_property (const char* name, const char* cstr) { diff --git a/libs/pbd/xml++.cc b/libs/pbd/xml++.cc index 95547b15ee..5b2ed2b190 100644 --- a/libs/pbd/xml++.cc +++ b/libs/pbd/xml++.cc @@ -286,7 +286,7 @@ XMLNode::operator= (const XMLNode& from) const XMLPropertyList& props = from.properties (); for (XMLPropertyConstIterator prop_iter = props.begin (); prop_iter != props.end (); ++prop_iter) { - add_property ((*prop_iter)->name ().c_str (), (*prop_iter)->value ()); + set_property ((*prop_iter)->name ().c_str (), (*prop_iter)->value ()); } const XMLNodeList& nodes = from.children (); @@ -551,8 +551,8 @@ XMLNode::has_property_with_value (const string& name, const string& value) const return false; } -XMLProperty* -XMLNode::add_property(const char* name, const string& value) +bool +XMLNode::set_property(const char* name, const string& value) { XMLPropertyIterator iter = _proplist.begin(); @@ -575,26 +575,6 @@ XMLNode::add_property(const char* name, const string& value) return new_property; } -XMLProperty* -XMLNode::add_property(const char* n, const char* v) -{ - string vs(v); - return add_property(n, vs); -} - -XMLProperty* -XMLNode::add_property(const char* name, const long value) -{ - char str[64]; - snprintf(str, sizeof(str), "%ld", 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 { @@ -713,7 +693,7 @@ readnode(xmlNodePtr node) if (attr->children) { content = (char*)attr->children->content; } - tmp->add_property((const char*)attr->name, content); + tmp->set_property((const char*)attr->name, content); } if (node->content) { -- cgit v1.2.3