From eefd32c2e797fb5fae8185e5c4f707c5a031354a Mon Sep 17 00:00:00 2001 From: "arseny.kapoulkine@gmail.com" Date: Tue, 27 Mar 2012 05:31:33 +0000 Subject: 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 --- contrib/foreach.hpp | 46 ++++------------------------------------------ 1 file changed, 4 insertions(+), 42 deletions(-) (limited to 'contrib') 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 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 attributes(const pugi::xml_node& node) { - xml_node_attribute_adapter result = {node}; - return result; + return node.attributes(); } } -- cgit v1.2.3