summaryrefslogtreecommitdiff
path: root/libs/pbd/xml++.cc
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2006-10-31 02:40:08 +0000
committerPaul Davis <paul@linuxaudiosystems.com>2006-10-31 02:40:08 +0000
commit71c94e69438c7c282b2dcac5ead080119944b290 (patch)
tree17bc6b75ff24c0eca6a7a45043f2c9d11cc2ff0c /libs/pbd/xml++.cc
parent74df5d49c8ff42c05d7eb9300c3a9f9a7257e694 (diff)
massive changes in automation state handling, not entirely complete; some bug fixes for automation line drawing
git-svn-id: svn://localhost/ardour2/trunk@1034 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/pbd/xml++.cc')
-rw-r--r--libs/pbd/xml++.cc29
1 files changed, 27 insertions, 2 deletions
diff --git a/libs/pbd/xml++.cc b/libs/pbd/xml++.cc
index 03fa116279..1b10be89f5 100644
--- a/libs/pbd/xml++.cc
+++ b/libs/pbd/xml++.cc
@@ -216,13 +216,38 @@ XMLNode::set_content(const string & c)
return _content;
}
+XMLNode*
+XMLNode::child (const char *name) const
+{
+ /* returns first child matching name */
+
+ static XMLNodeList retval;
+ XMLNodeConstIterator cur;
+
+ if (name == 0) {
+ return 0;
+ }
+
+ retval.erase(retval.begin(), retval.end());
+
+ for (cur = _children.begin(); cur != _children.end(); ++cur) {
+ if ((*cur)->name() == name) {
+ return *cur;
+ }
+ }
+
+ return 0;
+}
+
const XMLNodeList &
-XMLNode::children(const string & n) const
+XMLNode::children(const string& n) const
{
+ /* returns all children matching name */
+
static XMLNodeList retval;
XMLNodeConstIterator cur;
- if (n.length() == 0) {
+ if (n.empty()) {
return _children;
}