mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-10 17:58:20 +00:00
Implement --use-names and --use-guids for DAE, OBJ, and SVG output.
This commit is contained in:
@@ -160,3 +160,28 @@ boost::regex IfcUtil::wildcard_string_to_regex(std::string str)
|
||||
boost::replace_all(str, "*", ".*");
|
||||
return boost::regex(str);
|
||||
}
|
||||
|
||||
void IfcUtil::sanitate_material_name(std::string &str)
|
||||
{
|
||||
// Spaces in material names have been observed to cause problems with obj and dae importers.
|
||||
// Handle other potential problematic characters here too if observing problems.
|
||||
boost::replace_all(str, " ", "_");
|
||||
}
|
||||
|
||||
void IfcUtil::escape_xml(std::string &str)
|
||||
{
|
||||
boost::replace_all(str, "\"", """);
|
||||
boost::replace_all(str, "'", "'");
|
||||
boost::replace_all(str, "<", "<");
|
||||
boost::replace_all(str, ">", ">");
|
||||
boost::replace_all(str, "&", "&");
|
||||
}
|
||||
|
||||
void IfcUtil::unescape_xml(std::string &str)
|
||||
{
|
||||
boost::replace_all(str, """, "\"");
|
||||
boost::replace_all(str, "'", "'");
|
||||
boost::replace_all(str, "<", "<");
|
||||
boost::replace_all(str, ">", ">");
|
||||
boost::replace_all(str, "&", "&");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user