mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-08 15:54:57 +01:00
Add debug() method to dump XML nodes.
git-svn-id: svn://localhost/ardour2/branches/3.0@7083 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
parent
78b8eaf565
commit
542372cd18
2 changed files with 17 additions and 0 deletions
|
|
@ -110,6 +110,8 @@ public:
|
||||||
/** Remove and delete all nodes with property prop matching val */
|
/** Remove and delete all nodes with property prop matching val */
|
||||||
void remove_nodes_and_delete(const std::string& propname, const std::string& val);
|
void remove_nodes_and_delete(const std::string& propname, const std::string& val);
|
||||||
|
|
||||||
|
void debug (std::ostream &, std::string p = "");
|
||||||
|
|
||||||
private:
|
private:
|
||||||
std::string _name;
|
std::string _name;
|
||||||
bool _is_content;
|
bool _is_content;
|
||||||
|
|
|
||||||
|
|
@ -5,6 +5,7 @@
|
||||||
* Modified for Ardour and released under the same terms.
|
* Modified for Ardour and released under the same terms.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include <iostream>
|
||||||
#include "pbd/xml++.h"
|
#include "pbd/xml++.h"
|
||||||
#include <libxml/debugXML.h>
|
#include <libxml/debugXML.h>
|
||||||
#include <libxml/xpath.h>
|
#include <libxml/xpath.h>
|
||||||
|
|
@ -589,3 +590,17 @@ static XMLSharedNodeList* find_impl(xmlXPathContext* ctxt, const string& xpath)
|
||||||
return nodes;
|
return nodes;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** Dump a node, its properties and children to a stream */
|
||||||
|
void
|
||||||
|
XMLNode::debug (ostream& s, string p)
|
||||||
|
{
|
||||||
|
s << p << _name << " ";
|
||||||
|
for (XMLPropertyList::iterator i = _proplist.begin(); i != _proplist.end(); ++i) {
|
||||||
|
s << (*i)->name() << "=" << (*i)->value() << " ";
|
||||||
|
}
|
||||||
|
s << "\n";
|
||||||
|
|
||||||
|
for (XMLNodeList::iterator i = _children.begin(); i != _children.end(); ++i) {
|
||||||
|
(*i)->debug (s, p + " ");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue