Move PBD::canonical_path to pbd/file_utils.h/cc and reimplement for Windows
[ardour.git] / libs / pbd / pbd / xml++.h
index e6795e5d455a0b2b9697322d8de57608ff562d64..f0956edd259617584de6dc692080aad4de3ee9e2 100644 (file)
@@ -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 <string>
-#include <list>
+#include <vector>
 #include <map>
 #include <cstdio>
 #include <cstdarg>
@@ -43,14 +43,14 @@ class XMLTree;
 class XMLNode;
 class XMLProperty;
 
-typedef std::list<XMLNode *>                   XMLNodeList;
-typedef std::list<boost::shared_ptr<XMLNode> > XMLSharedNodeList;
-typedef XMLNodeList::iterator                  XMLNodeIterator;
-typedef XMLNodeList::const_iterator            XMLNodeConstIterator;
-typedef std::list<XMLProperty*>                XMLPropertyList;
-typedef XMLPropertyList::iterator              XMLPropertyIterator;
-typedef XMLPropertyList::const_iterator        XMLPropertyConstIterator;
-typedef std::map<std::string, XMLProperty*>    XMLPropertyMap;
+typedef std::vector<XMLNode *>                   XMLNodeList;
+typedef std::vector<boost::shared_ptr<XMLNode> > XMLSharedNodeList;
+typedef XMLNodeList::iterator                    XMLNodeIterator;
+typedef XMLNodeList::const_iterator              XMLNodeConstIterator;
+typedef std::vector<XMLProperty*>                XMLPropertyList;
+typedef XMLPropertyList::iterator                XMLPropertyIterator;
+typedef XMLPropertyList::const_iterator          XMLPropertyConstIterator;
+typedef std::map<std::string, XMLProperty*>      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<XMLNode*>(this)->property(n); }
-        const XMLProperty* property(const std::string& n) const { return const_cast<XMLNode*>(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);