2525
2626#include " IfcGeom.h"
2727
28+ #include < boost/foreach.hpp>
2829#include < boost/function.hpp>
2930#include < boost/regex.hpp>
3031#include < boost/algorithm/string/replace.hpp>
@@ -87,7 +88,7 @@ namespace IfcGeom
8788 void populate (const std::set<std::string>& patterns)
8889 {
8990 values.clear ();
90- foreach (const std::string &pattern, patterns) {
91+ BOOST_FOREACH (const std::string &pattern, patterns) {
9192 values.insert (wildcard_string_to_regex (pattern));
9293 }
9394 }
@@ -96,7 +97,7 @@ namespace IfcGeom
9697
9798 static bool match_values (const std::set<boost::regex>& values, const std::string &str)
9899 {
99- foreach (const boost::regex& r, values) {
100+ BOOST_FOREACH (const boost::regex& r, values) {
100101 if (boost::regex_match (str, r)) {
101102 return true ;
102103 }
@@ -108,7 +109,7 @@ namespace IfcGeom
108109 {
109110 // Escape all non-"*?" regex special chars
110111 static const std::string special_chars = " \\ ^.$|()[]+/" ;
111- foreach (char c, special_chars) {
112+ BOOST_FOREACH (char c, special_chars) {
112113 std::string char_str (1 , c);
113114 boost::replace_all (str, char_str, " \\ " + char_str);
114115 }
@@ -180,7 +181,7 @@ namespace IfcGeom
180181
181182 ss << (traverse ? " traverse " : " " ) << (include ? " include" : " exclude" );
182183 std::vector<std::string> patterns;
183- foreach (const boost::regex& r, values) {
184+ BOOST_FOREACH (const boost::regex& r, values) {
184185 patterns.push_back (" \" " + r.str () + " \" " );
185186 }
186187
@@ -237,7 +238,7 @@ namespace IfcGeom
237238 std::stringstream ss;
238239 ss << (traverse ? " traverse " : " " ) << (include ? " include" : " exclude" ) << " layers" ;
239240 std::vector<std::string> str_values;
240- foreach (const boost::regex& r, values) {
241+ BOOST_FOREACH (const boost::regex& r, values) {
241242 str_values.push_back (" \" " + r.str () + " \" " );
242243 }
243244 ss << boost::algorithm::join (str_values, " " );
@@ -259,7 +260,7 @@ namespace IfcGeom
259260 void populate (const std::set<std::string>& types)
260261 {
261262 values.clear ();
262- foreach (const std::string& type, types) {
263+ BOOST_FOREACH (const std::string& type, types) {
263264 IfcSchema::Type::Enum ty;
264265 try {
265266 ty = IfcSchema::Type::FromString (boost::to_upper_copy (type));
@@ -274,7 +275,7 @@ namespace IfcGeom
274275 bool match (IfcSchema::IfcProduct* prod) const
275276 {
276277 // The set is iterated over to able to filter on subtypes.
277- foreach (IfcSchema::Type::Enum type, values) {
278+ BOOST_FOREACH (IfcSchema::Type::Enum type, values) {
278279 if (prod->is (type)) {
279280 return true ;
280281 }
@@ -291,7 +292,7 @@ namespace IfcGeom
291292 {
292293 std::stringstream ss;
293294 ss << (traverse ? " traverse " : " " ) << (include ? " include" : " exclude" ) << " entities" ;
294- foreach (IfcSchema::Type::Enum type, values) {
295+ BOOST_FOREACH (IfcSchema::Type::Enum type, values) {
295296 ss << " " << IfcSchema::Type::ToString (type);
296297 }
297298 description = ss.str ();
0 commit comments