From 5ac22e9095d5f851b5238029e3f813bc86fe2280 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Sat, 16 Jun 2012 17:20:10 +0000 Subject: Add new SharedStatefulProperty which manages a shared_ptr to some Stateful object, and a subclass to use this for AutomationList. SharedStatefulProperty will manage undo / redo using full copies of the XML state, like MementoCommand, but does it within the Property undo system. git-svn-id: svn://localhost/ardour2/branches/3.0@12740 d708f5d6-7413-0410-9779-e7cbd77b26cf --- libs/pbd/xml++.cc | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) (limited to 'libs/pbd/xml++.cc') diff --git a/libs/pbd/xml++.cc b/libs/pbd/xml++.cc index e2ccd67738..3046f971ab 100644 --- a/libs/pbd/xml++.cc +++ b/libs/pbd/xml++.cc @@ -652,13 +652,19 @@ static XMLSharedNodeList* find_impl(xmlXPathContext* ctxt, const string& xpath) void XMLNode::dump (ostream& s, string p) const { - s << p << _name << " "; - for (XMLPropertyList::const_iterator i = _proplist.begin(); i != _proplist.end(); ++i) { - s << (*i)->name() << "=" << (*i)->value() << " "; - } - s << "\n"; - - for (XMLNodeList::const_iterator i = _children.begin(); i != _children.end(); ++i) { - (*i)->dump (s, p + " "); + if (_is_content) { + s << p << " " << content() << "\n"; + } else { + s << p << "<" << _name; + for (XMLPropertyList::const_iterator i = _proplist.begin(); i != _proplist.end(); ++i) { + s << " " << (*i)->name() << "=\"" << (*i)->value() << "\""; + } + s << ">\n"; + + for (XMLNodeList::const_iterator i = _children.begin(); i != _children.end(); ++i) { + (*i)->dump (s, p + " "); + } + + s << p << "\n"; } } -- cgit v1.2.3