RDFS
The Rice Comp413 2017 class' continuation on the work of the 2016 RDFS.
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Pages
foreach.hpp
1 /*
2  * Boost.Foreach support for pugixml classes.
3  * This file is provided to the public domain.
4  * Written by Arseny Kapoulkine (arseny.kapoulkine@gmail.com)
5  */
6 
7 #ifndef HEADER_PUGIXML_FOREACH_HPP
8 #define HEADER_PUGIXML_FOREACH_HPP
9 
10 #include <boost/range/iterator.hpp>
11 
12 #include "pugixml.hpp"
13 
14 /*
15  * These types add support for BOOST_FOREACH macro to xml_node and xml_document classes (child iteration only).
16  * Example usage:
17  * BOOST_FOREACH(xml_node n, doc) {}
18  */
19 
20 namespace boost
21 {
22  template<> struct range_mutable_iterator<pugi::xml_node>
23  {
25  };
26 
27  template<> struct range_const_iterator<pugi::xml_node>
28  {
30  };
31 
32  template<> struct range_mutable_iterator<pugi::xml_document>
33  {
35  };
36 
37  template<> struct range_const_iterator<pugi::xml_document>
38  {
40  };
41 }
42 
43 /*
44  * These types add support for BOOST_FOREACH macro to xml_node and xml_document classes (child/attribute iteration).
45  * Example usage:
46  * BOOST_FOREACH(xml_node n, children(doc)) {}
47  * BOOST_FOREACH(xml_node n, attributes(doc)) {}
48  */
49 
50 namespace pugi
51 {
52  inline xml_object_range<xml_node_iterator> children(const pugi::xml_node& node)
53  {
54  return node.children();
55  }
56 
57  inline xml_object_range<xml_attribute_iterator> attributes(const pugi::xml_node& node)
58  {
59  return node.attributes();
60  }
61 }
62 
63 #endif
Definition: pugixml.hpp:750
Definition: pugixml.hpp:406