mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-24 22:10:00 +00:00
Emit an error message rather than exception for GlobalId parsing inconsistencies to accomodate files with invalid GlobalIds.
This commit is contained in:
@@ -26,6 +26,7 @@
|
|||||||
|
|
||||||
#include "../ifcparse/IfcGlobalId.h"
|
#include "../ifcparse/IfcGlobalId.h"
|
||||||
#include "../ifcparse/IfcException.h"
|
#include "../ifcparse/IfcException.h"
|
||||||
|
#include "../ifcparse/IfcUtil.h"
|
||||||
|
|
||||||
static const char* chars = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz_$";
|
static const char* chars = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz_$";
|
||||||
|
|
||||||
@@ -94,7 +95,7 @@ IfcParse::IfcGlobalId::IfcGlobalId() {
|
|||||||
boost::uuids::uuid test_uuid;
|
boost::uuids::uuid test_uuid;
|
||||||
std::copy(test_vector.begin(), test_vector.end(), test_uuid.begin());
|
std::copy(test_vector.begin(), test_vector.end(), test_uuid.begin());
|
||||||
if (uuid_data != test_uuid) {
|
if (uuid_data != test_uuid) {
|
||||||
throw IfcParse::IfcException("Internal error generating GlobalId");
|
Logger::Message(Logger::LOG_ERROR, "Internal error generating GlobalId");
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
@@ -110,7 +111,7 @@ IfcParse::IfcGlobalId::IfcGlobalId(const std::string& s)
|
|||||||
#ifndef NDEBUG
|
#ifndef NDEBUG
|
||||||
const std::string test_string = compress(&uuid_data.data[0]);
|
const std::string test_string = compress(&uuid_data.data[0]);
|
||||||
if (string_data != test_string) {
|
if (string_data != test_string) {
|
||||||
throw IfcParse::IfcException("Internal error generating GlobalId");
|
Logger::Message(Logger::LOG_ERROR, "Internal error generating GlobalId");
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user