diff options
author | arseny.kapoulkine@gmail.com <arseny.kapoulkine@gmail.com@99668b35-9821-0410-8761-19e4c4f06640> | 2012-03-27 05:31:33 +0000 |
---|---|---|
committer | arseny.kapoulkine@gmail.com <arseny.kapoulkine@gmail.com@99668b35-9821-0410-8761-19e4c4f06640> | 2012-03-27 05:31:33 +0000 |
commit | eefd32c2e797fb5fae8185e5c4f707c5a031354a (patch) | |
tree | 4038689ad95208f3700fe41c7fdd90b6980ee1c5 /contrib/foreach.hpp | |
parent | 951ff9d1a62a509861f95f90e984b6724cd4af3f (diff) |
contrib: Foreach contrib file is not really needed any more; left for compatibility, + removed node/attribute adapters since we now have object range support in pugixml.hpp
git-svn-id: http://pugixml.googlecode.com/svn/trunk@891 99668b35-9821-0410-8761-19e4c4f06640
Diffstat (limited to 'contrib/foreach.hpp')
-rw-r--r-- | contrib/foreach.hpp | 46 |
1 files changed, 4 insertions, 42 deletions
diff --git a/contrib/foreach.hpp b/contrib/foreach.hpp index 2abec19..3198077 100644 --- a/contrib/foreach.hpp +++ b/contrib/foreach.hpp @@ -50,52 +50,14 @@ namespace boost namespace pugi { - struct xml_node_children_adapter + inline xml_object_range<xml_node_iterator> children(const pugi::xml_node& node) { - typedef pugi::xml_node::iterator iterator; - typedef pugi::xml_node::iterator const_iterator; - - xml_node node; - - const_iterator begin() const - { - return node.begin(); - } - - const_iterator end() const - { - return node.end(); - } - }; - - inline xml_node_children_adapter children(const pugi::xml_node& node) - { - xml_node_children_adapter result = {node}; - return result; + return node.children(); } - struct xml_node_attribute_adapter - { - typedef pugi::xml_node::attribute_iterator iterator; - typedef pugi::xml_node::attribute_iterator const_iterator; - - xml_node node; - - const_iterator begin() const - { - return node.attributes_begin(); - } - - const_iterator end() const - { - return node.attributes_end(); - } - }; - - inline xml_node_attribute_adapter attributes(const pugi::xml_node& node) + inline xml_object_range<xml_attribute_iterator> attributes(const pugi::xml_node& node) { - xml_node_attribute_adapter result = {node}; - return result; + return node.attributes(); } } |