diff options
author | Tim Mayberry <mojofunk@gmail.com> | 2016-09-02 23:08:32 +1000 |
---|---|---|
committer | Tim Mayberry <mojofunk@gmail.com> | 2017-04-19 09:36:48 +1000 |
commit | ae27e33f293e709e7f15e4ede9cb0b7a155a27f3 (patch) | |
tree | 19c6110f62018a51c9fc1b0348c42dd97afc25cc /libs/pbd/xml++.cc | |
parent | 8f516a2c4feb060339bcc6deaee429ab7112cb10 (diff) |
Add a template based get/set_property API to PBD::XMLNode
Diffstat (limited to 'libs/pbd/xml++.cc')
-rw-r--r-- | libs/pbd/xml++.cc | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/libs/pbd/xml++.cc b/libs/pbd/xml++.cc index dbe6d51e0d..95547b15ee 100644 --- a/libs/pbd/xml++.cc +++ b/libs/pbd/xml++.cc @@ -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) { |