11
11
// Tiago de Paula Peixoto
12
12
13
13
#define BOOST_GRAPH_SOURCE
14
- #include < boost/foreach.hpp>
15
14
#include < boost/optional.hpp>
16
15
#include < boost/throw_exception.hpp>
17
16
#include < boost/graph/graphml.hpp>
@@ -44,7 +43,7 @@ class graphml_reader
44
43
using boost::property_tree::ptree;
45
44
size_t current_idx = 0 ;
46
45
bool is_first = is_root;
47
- BOOST_FOREACH (const ptree::value_type& n, top)
46
+ for (const ptree::value_type& n: top)
48
47
{
49
48
if (n.first == " graph" )
50
49
{
@@ -54,7 +53,7 @@ class graphml_reader
54
53
if (is_first)
55
54
{
56
55
is_first = false ;
57
- BOOST_FOREACH (const ptree::value_type& attr, n.second )
56
+ for (const ptree::value_type& attr: n.second )
58
57
{
59
58
if (attr.first != " data" )
60
59
continue ;
@@ -83,7 +82,7 @@ class graphml_reader
83
82
| boost::property_tree::xml_parser::trim_whitespace);
84
83
ptree gml = pt.get_child (path (" graphml" ));
85
84
// Search for attributes
86
- BOOST_FOREACH (const ptree::value_type& child, gml)
85
+ for (const ptree::value_type& child: gml)
87
86
{
88
87
if (child.first != " key" )
89
88
continue ;
@@ -127,17 +126,17 @@ class graphml_reader
127
126
std::vector< const ptree* > graphs;
128
127
handle_graph ();
129
128
get_graphs (gml, desired_idx, true , graphs);
130
- BOOST_FOREACH (const ptree* gr, graphs)
129
+ for (const ptree* gr: graphs)
131
130
{
132
131
// Search for nodes
133
- BOOST_FOREACH (const ptree::value_type& node, *gr)
132
+ for (const ptree::value_type& node: *gr)
134
133
{
135
134
if (node.first != " node" )
136
135
continue ;
137
136
std::string id
138
137
= node.second .get < std::string >(path (" <xmlattr>/id" ));
139
138
handle_vertex (id);
140
- BOOST_FOREACH (const ptree::value_type& attr, node.second )
139
+ for (const ptree::value_type& attr: node.second )
141
140
{
142
141
if (attr.first != " data" )
143
142
continue ;
@@ -148,13 +147,13 @@ class graphml_reader
148
147
}
149
148
}
150
149
}
151
- BOOST_FOREACH (const ptree* gr, graphs)
150
+ for (const ptree* gr: graphs)
152
151
{
153
152
bool default_directed
154
153
= gr->get < std::string >(path (" <xmlattr>/edgedefault" ))
155
154
== " directed" ;
156
155
// Search for edges
157
- BOOST_FOREACH (const ptree::value_type& edge, *gr)
156
+ for (const ptree::value_type& edge: *gr)
158
157
{
159
158
if (edge.first != " edge" )
160
159
continue ;
@@ -180,7 +179,7 @@ class graphml_reader
180
179
}
181
180
size_t old_edges_size = m_edge.size ();
182
181
handle_edge (source, target);
183
- BOOST_FOREACH (const ptree::value_type& attr, edge.second )
182
+ for (const ptree::value_type& attr: edge.second )
184
183
{
185
184
if (attr.first != " data" )
186
185
continue ;
0 commit comments