From 2edf86781826542a9a5849609ec1f37a0c9661c7 Mon Sep 17 00:00:00 2001 From: Stinkfist0 Date: Mon, 3 Apr 2017 23:02:37 +0300 Subject: [PATCH] Use boost functions for string manipulation instead of std ones in order to silence char-int conversion warnings on VS 2017. --- src/ifcgeom/IfcGeomElement.h | 6 +++--- src/ifcgeom/IfcGeomRenderStyles.h | 7 +++++-- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/src/ifcgeom/IfcGeomElement.h b/src/ifcgeom/IfcGeomElement.h index 820727533a..ef34462df9 100644 --- a/src/ifcgeom/IfcGeomElement.h +++ b/src/ifcgeom/IfcGeomElement.h @@ -101,8 +101,8 @@ namespace IfcGeom { oss << "product-" << IfcParse::IfcGlobalId(guid).formatted(); if (!_context.empty()) { std::string ctx = _context; - std::transform(ctx.begin(), ctx.end(), ctx.begin(), ::tolower); - std::replace(ctx.begin(), ctx.end(), ' ', '-'); + boost::to_lower(ctx); + boost::replace_all(ctx, " ", "-"); oss << "-" << ctx; } _unique_id = oss.str(); @@ -167,4 +167,4 @@ namespace IfcGeom { }; } -#endif \ No newline at end of file +#endif diff --git a/src/ifcgeom/IfcGeomRenderStyles.h b/src/ifcgeom/IfcGeomRenderStyles.h index 5c499d58dc..39a67136dd 100644 --- a/src/ifcgeom/IfcGeomRenderStyles.h +++ b/src/ifcgeom/IfcGeomRenderStyles.h @@ -27,6 +27,9 @@ #include "../ifcparse/Ifc2x3.h" #endif +#include +#include + namespace IfcGeom { class IFC_GEOM_API SurfaceStyle { public: @@ -63,8 +66,8 @@ namespace IfcGeom { { std::stringstream sstr; std::string sanitized = name; - std::transform(sanitized.begin(), sanitized.end(), sanitized.begin(), ::tolower); - std::replace(sanitized.begin(), sanitized.end(), ' ', '-'); + boost::to_lower(sanitized); + boost::replace_all(sanitized, " ", "-"); sstr << "surface-style-" << id << "-" << sanitized; this->name = sstr.str(); }