summaryrefslogtreecommitdiff
path: root/libs/pbd
diff options
context:
space:
mode:
authorTim Mayberry <mojofunk@gmail.com>2016-08-30 18:59:05 +1000
committerTim Mayberry <mojofunk@gmail.com>2017-04-19 09:36:57 +1000
commit6e467153a087497a21c8a584820da00241bc42cf (patch)
tree89a536e07e0e6461eb3841b251c225b232412d1f /libs/pbd
parente4b1ece143d877a4cb713956c13f5f6fee50d3e6 (diff)
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.
Diffstat (limited to 'libs/pbd')
-rw-r--r--libs/pbd/pbd/xml++.h4
-rw-r--r--libs/pbd/xml++.cc28
2 files changed, 4 insertions, 28 deletions
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) {