From 8e0c64401f1b6f7b8a1ad5cc68227fc344f149dc Mon Sep 17 00:00:00 2001 From: "arseny.kapoulkine" Date: Tue, 6 Jul 2010 18:51:29 +0000 Subject: xml_node::all_elements_by_name is now deprecated git-svn-id: http://pugixml.googlecode.com/svn/trunk@563 99668b35-9821-0410-8761-19e4c4f06640 --- src/pugixml.hpp | 39 +++++++++++++++++++++++---------------- 1 file changed, 23 insertions(+), 16 deletions(-) (limited to 'src') diff --git a/src/pugixml.hpp b/src/pugixml.hpp index 376d4e4..a1254b6 100644 --- a/src/pugixml.hpp +++ b/src/pugixml.hpp @@ -791,6 +791,25 @@ namespace pugi explicit xml_node(xml_node_struct* p); private: + template void all_elements_by_name_helper(const char_t* name, OutputIterator it) const + { + if (!_root) return; + + for (xml_node node = first_child(); node; node = node.next_sibling()) + { + if (node.type() == node_element) + { + if (impl::strequal(name, node.name())) + { + *it = node; + ++it; + } + + if (node.first_child()) node.all_elements_by_name_helper(name, it); + } + } + } + template void all_elements_by_name_w_helper(const char_t* name, OutputIterator it) const { if (!_root) return; @@ -1241,24 +1260,12 @@ namespace pugi * * \param name - node name * \param it - output iterator (for example, std::back_insert_iterator (result of std::back_inserter)) + * + * \deprecated This function is deprecated */ - template void all_elements_by_name(const char_t* name, OutputIterator it) const + template PUGIXML_DEPRECATED void all_elements_by_name(const char_t* name, OutputIterator it) const { - if (!_root) return; - - for (xml_node node = first_child(); node; node = node.next_sibling()) - { - if (node.type() == node_element) - { - if (impl::strequal(name, node.name())) - { - *it = node; - ++it; - } - - if (node.first_child()) node.all_elements_by_name(name, it); - } - } + all_elements_by_name_helper(name, it); } /** -- cgit v1.2.3