diff options
author | Carl Hetherington <carl@carlh.net> | 2012-06-16 17:20:10 +0000 |
---|---|---|
committer | Carl Hetherington <carl@carlh.net> | 2012-06-16 17:20:10 +0000 |
commit | 5ac22e9095d5f851b5238029e3f813bc86fe2280 (patch) | |
tree | 51460c63aa9ace692dedceb01494f2a92d4bc364 /libs/pbd/xml++.cc | |
parent | 9429401f11ffa0ee1729dbdc5e14e87cf06e2dc1 (diff) |
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
Diffstat (limited to 'libs/pbd/xml++.cc')
-rw-r--r-- | libs/pbd/xml++.cc | 22 |
1 files changed, 14 insertions, 8 deletions
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 << "</" << _name << ">\n"; } } |