Use boost::to_lower()

This commit is contained in:
aothms
2015-10-05 13:34:43 +02:00
parent c20afd24a5
commit db6630c1f8
2 changed files with 7 additions and 13 deletions
+4 -8
View File
@@ -32,6 +32,7 @@
#include <time.h>
#include <boost/program_options.hpp>
#include <boost/algorithm/string.hpp>
#include "../ifcgeom/IfcGeomIterator.h"
@@ -197,11 +198,8 @@ int main(int argc, char** argv) {
// Gets the set ifc types to be ignored from the command line.
std::set<std::string> entities;
for (std::vector<std::string>::const_iterator it = entity_vector.begin(); it != entity_vector.end(); ++it) {
std::string lowercase_type = *it;
for (std::string::iterator c = lowercase_type.begin(); c != lowercase_type.end(); ++c) {
*c = tolower(*c);
}
entities.insert(lowercase_type);
const std::string& mixed_case_type = *it;
entities.insert(boost::to_lower_copy(mixed_case_type));
}
const std::string input_filename = vmap["input-file"].as<std::string>();
@@ -217,9 +215,7 @@ int main(int argc, char** argv) {
}
std::string output_extension = output_filename.substr(output_filename.size()-4);
for (std::string::iterator c = output_extension.begin(); c != output_extension.end(); ++c) {
*c = tolower(*c);
}
boost::to_lower(output_extension);
// If no entities are specified these are the defaults to skip from output
if (entity_vector.empty()) {
+3 -5
View File
@@ -181,11 +181,9 @@ namespace IfcGeom {
continue;
}
if (context->hasContextType()) {
std::string context_type_lc = context->ContextType();
for (std::string::iterator c = context_type_lc.begin(); c != context_type_lc.end(); ++c) {
*c = tolower(*c);
}
if (context_types.find(context_type_lc) != context_types.end()) {
std::string context_type = context->ContextType();
boost::to_lower(context_type);
if (context_types.find(context_type) != context_types.end()) {
filtered_contexts->push(context);
}
}