mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-23 17:26:30 +00:00
Remove newlines and other characters from material names
This commit is contained in:
@@ -65,7 +65,9 @@ namespace IfcGeom {
|
|||||||
std::stringstream sstr;
|
std::stringstream sstr;
|
||||||
std::string sanitized = name;
|
std::string sanitized = name;
|
||||||
boost::to_lower(sanitized);
|
boost::to_lower(sanitized);
|
||||||
boost::replace_all(sanitized, " ", "-");
|
std::replace_if(sanitized.begin(), sanitized.end(), [](char c) {
|
||||||
|
return c < 0x21 || c > 0x7e;
|
||||||
|
}, '-');
|
||||||
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