mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-10-03 13:28:19 +00:00
Use boost functions for string manipulation instead of std ones in order to silence char-int conversion warnings on VS 2017.
This commit is contained in:
committed by
Thomas Krijnen
parent
e4a7d2a149
commit
2edf867818
@@ -101,8 +101,8 @@ namespace IfcGeom {
|
|||||||
oss << "product-" << IfcParse::IfcGlobalId(guid).formatted();
|
oss << "product-" << IfcParse::IfcGlobalId(guid).formatted();
|
||||||
if (!_context.empty()) {
|
if (!_context.empty()) {
|
||||||
std::string ctx = _context;
|
std::string ctx = _context;
|
||||||
std::transform(ctx.begin(), ctx.end(), ctx.begin(), ::tolower);
|
boost::to_lower(ctx);
|
||||||
std::replace(ctx.begin(), ctx.end(), ' ', '-');
|
boost::replace_all(ctx, " ", "-");
|
||||||
oss << "-" << ctx;
|
oss << "-" << ctx;
|
||||||
}
|
}
|
||||||
_unique_id = oss.str();
|
_unique_id = oss.str();
|
||||||
@@ -167,4 +167,4 @@ namespace IfcGeom {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -27,6 +27,9 @@
|
|||||||
#include "../ifcparse/Ifc2x3.h"
|
#include "../ifcparse/Ifc2x3.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#include <boost/algorithm/string/case_conv.hpp>
|
||||||
|
#include <boost/algorithm/string/replace.hpp>
|
||||||
|
|
||||||
namespace IfcGeom {
|
namespace IfcGeom {
|
||||||
class IFC_GEOM_API SurfaceStyle {
|
class IFC_GEOM_API SurfaceStyle {
|
||||||
public:
|
public:
|
||||||
@@ -63,8 +66,8 @@ namespace IfcGeom {
|
|||||||
{
|
{
|
||||||
std::stringstream sstr;
|
std::stringstream sstr;
|
||||||
std::string sanitized = name;
|
std::string sanitized = name;
|
||||||
std::transform(sanitized.begin(), sanitized.end(), sanitized.begin(), ::tolower);
|
boost::to_lower(sanitized);
|
||||||
std::replace(sanitized.begin(), sanitized.end(), ' ', '-');
|
boost::replace_all(sanitized, " ", "-");
|
||||||
sstr << "surface-style-" << id << "-" << sanitized;
|
sstr << "surface-style-" << id << "-" << sanitized;
|
||||||
this->name = sstr.str();
|
this->name = sstr.str();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user