Make global static children variable an xml node object variable.
[ardour.git] / libs / pbd / pbd / xml++.h
index afb896e1d537c57fdec265c21c703fa2c8e5684f..f98f7854d1c14e5121aa967a70bdda7439b3ee62 100644 (file)
@@ -37,7 +37,6 @@ private:
   string _filename;
   XMLNode *_root;
   int _compression;
-  bool _initialized;
 
 public:
   XMLTree();
@@ -45,9 +44,8 @@ public:
   XMLTree(const XMLTree *);
   ~XMLTree();
 
-  bool initialized() const { return _initialized; };
   XMLNode *root() const { return _root; };
-  XMLNode *set_root(XMLNode *n) { _initialized = true; return _root = n; };
+  XMLNode *set_root(XMLNode *n) { return _root = n; };
 
   const string & filename() const { return _filename; };
   const string & set_filename(const string &fn) { return _filename = fn; };
@@ -69,13 +67,13 @@ public:
 
 class XMLNode {
 private:
-  bool _initialized;
   string _name;
   bool _is_content;
   string _content;
   XMLNodeList _children;
   XMLPropertyList _proplist;
   XMLPropertyMap _propmap;
+  mutable XMLNodeList _selected_children;
 
 public:
   XMLNode(const string &);
@@ -83,23 +81,26 @@ public:
   XMLNode(const XMLNode&);
   ~XMLNode();
 
-  bool initialized() const { return _initialized; };
   const string name() const { return _name; };
 
   bool is_content() const { return _is_content; };
   const string & content() const { return _content; };
-  const string & set_content(const string &);
+  const string & set_content (const string &);
   XMLNode *add_content(const string & = string());
 
-  const XMLNodeList & children(const string & = string()) const;
-  XMLNode *add_child(const char *);
-  XMLNode *add_child_copy(const XMLNode&);
-  void     add_child_nocopy (XMLNode&);
+  const XMLNodeList & children (const string& str = string()) const;
+  XMLNode *add_child (const char *);
+  XMLNode *add_child_copy (const XMLNode&);
+  XMLNode *child (const char*) const;
+  void add_child_nocopy (XMLNode&);
 
   const XMLPropertyList & properties() const { return _proplist; };
   XMLProperty *property(const char * );
+  XMLProperty *property(const std::string&);
   const XMLProperty *property(const char * n) const
        { return ((XMLNode *) this)->property(n); };
+  const XMLProperty *property(const std::string& ns) const
+       { return ((XMLNode *) this)->property(ns); };
   XMLProperty *add_property(const char *, const string &);
   XMLProperty *add_property(const char *, const char * = "");