*/
#include <iostream>
+
+#include "pbd/stacktrace.h"
#include "pbd/xml++.h"
+
#include <libxml/debugXML.h>
#include <libxml/xpath.h>
#include <libxml/xpathInternals.h>
return add_child_copy(XMLNode (string(), c));
}
-XMLProperty*
+XMLProperty const *
+XMLNode::property(const char* n) const
+{
+ string ns(n);
+ map<string,XMLProperty*>::const_iterator iter;
+
+ if ((iter = _propmap.find(ns)) != _propmap.end()) {
+ return iter->second;
+ }
+
+ return 0;
+}
+
+XMLProperty const *
+XMLNode::property(const string& ns) const
+{
+ map<string,XMLProperty*>::const_iterator iter;
+
+ if ((iter = _propmap.find(ns)) != _propmap.end()) {
+ return iter->second;
+ }
+
+ return 0;
+}
+
+XMLProperty *
XMLNode::property(const char* n)
{
string ns(n);
return 0;
}
-XMLProperty*
+XMLProperty *
XMLNode::property(const string& ns)
{
map<string,XMLProperty*>::iterator iter;
return 0;
}
+bool
+XMLNode::has_property_with_value (const string& key, const string& value) const
+{
+ map<string,XMLProperty*>::const_iterator iter = _propmap.find(key);
+ if (iter != _propmap.end()) {
+ const XMLProperty* p = (iter->second);
+ return (p && p->value() == value);
+ }
+ return false;
+}
+
XMLProperty*
XMLNode::add_property(const char* n, const string& v)
{
XMLNode::remove_nodes_and_delete(const string& propname, const string& val)
{
XMLNodeIterator i = _children.begin();
- XMLProperty* prop;
+ XMLProperty const * prop;
while (i != _children.end()) {
prop = (*i)->property(propname);