summaryrefslogtreecommitdiff
path: root/src/node.h
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2007-05-19 02:58:38 +0000
committerJohn Wiegley <johnw@newartisans.com>2008-04-13 03:38:53 -0400
commitb6ab7deb63d3e3e22ecd4d6c70c6249db2ba558c (patch)
tree6cfe58ee8e093d310aa7ea84de87db3190c576bf /src/node.h
parent2d8512af88eab26176089e53916f309f2d3b3be4 (diff)
downloadfork-ledger-b6ab7deb63d3e3e22ecd4d6c70c6249db2ba558c.tar.gz
fork-ledger-b6ab7deb63d3e3e22ecd4d6c70c6249db2ba558c.tar.bz2
fork-ledger-b6ab7deb63d3e3e22ecd4d6c70c6249db2ba558c.zip
Completely revised the way XPath expressions are calculated.
Diffstat (limited to 'src/node.h')
-rw-r--r--src/node.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/node.h b/src/node.h
index 2a137e86..7b1f9919 100644
--- a/src/node.h
+++ b/src/node.h
@@ -87,12 +87,12 @@ public:
parent_node_t& as_parent_node() {
if (! is_parent_node())
throw_(std::logic_error, "Request to cast leaf node to a parent node");
- return *polymorphic_downcast<parent_node_t *>(this);
+ return downcast<parent_node_t>(*this);
}
const parent_node_t& as_parent_node() const {
if (! is_parent_node())
throw_(std::logic_error, "Request to cast leaf node to a parent node");
- return *polymorphic_downcast<const parent_node_t *>(this);
+ return downcast<const parent_node_t>(*this);
}
virtual value_t to_value() const = 0;
@@ -116,6 +116,7 @@ public:
attributes = attributes_t();
attributes->push_back(attr_pair(_name_id, value));
}
+ optional<const string&> get_attr(const string& _name) const;
optional<const string&> get_attr(const nameid_t _name_id) const {
if (attributes) {
typedef attributes_t::nth_index<1>::type attributes_by_name;