X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=libs%2Fpbd%2Fpbd%2Fxml%2B%2B.h;h=f0956edd259617584de6dc692080aad4de3ee9e2;hb=569167a603ef812a234d3c02f6a94976571a70ea;hp=e6795e5d455a0b2b9697322d8de57608ff562d64;hpb=2e27e21d3a09889311e18a8efe11abcaa6d9c8b3;p=ardour.git diff --git a/libs/pbd/pbd/xml++.h b/libs/pbd/pbd/xml++.h index e6795e5d45..f0956edd25 100644 --- a/libs/pbd/pbd/xml++.h +++ b/libs/pbd/pbd/xml++.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2012 Paul Davis + Copyright (C) 2012 Paul Davis This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -28,7 +28,7 @@ */ #include -#include +#include #include #include #include @@ -43,14 +43,14 @@ class XMLTree; class XMLNode; class XMLProperty; -typedef std::list XMLNodeList; -typedef std::list > XMLSharedNodeList; -typedef XMLNodeList::iterator XMLNodeIterator; -typedef XMLNodeList::const_iterator XMLNodeConstIterator; -typedef std::list XMLPropertyList; -typedef XMLPropertyList::iterator XMLPropertyIterator; -typedef XMLPropertyList::const_iterator XMLPropertyConstIterator; -typedef std::map XMLPropertyMap; +typedef std::vector XMLNodeList; +typedef std::vector > XMLSharedNodeList; +typedef XMLNodeList::iterator XMLNodeIterator; +typedef XMLNodeList::const_iterator XMLNodeConstIterator; +typedef std::vector XMLPropertyList; +typedef XMLPropertyList::iterator XMLPropertyIterator; +typedef XMLPropertyList::const_iterator XMLPropertyConstIterator; +typedef std::map XMLPropertyMap; class LIBPBD_API XMLTree { public: @@ -85,7 +85,7 @@ public: private: bool read_internal(bool validate); - + std::string _filename; XMLNode* _root; xmlDocPtr _doc; @@ -117,11 +117,13 @@ public: std::string attribute_value(); const XMLPropertyList& properties() const { return _proplist; } - XMLProperty* property(const char*); - XMLProperty* property(const std::string&); - const XMLProperty* property(const char* n) const { return const_cast(this)->property(n); } - const XMLProperty* property(const std::string& n) const { return const_cast(this)->property(n); } - + XMLProperty const * property(const char*) const; + XMLProperty const * property(const std::string&) const; + XMLProperty * property(const char*); + XMLProperty * property(const std::string&); + + 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);