| 95 | #endif |
| 96 | |
| 97 | IfcParse::IfcGlobalId::IfcGlobalId() { |
| 98 | uuid_data_ = gen(); |
| 99 | std::vector<unsigned char> v(uuid_data_.size()); |
| 100 | std::copy(uuid_data_.begin(), uuid_data_.end(), v.begin()); |
| 101 | string_data_ = compress(v.data()); |
| 102 | #if BOOST_VERSION < 104400 |
| 103 | formatted_string = boost::lexical_cast<std::string>(uuid_data); |
| 104 | #else |
| 105 | formatted_string_ = boost::uuids::to_string(uuid_data_); |
| 106 | #endif |
| 107 | |
| 108 | #ifndef NDEBUG |
| 109 | std::vector<unsigned char> test_vector; |
| 110 | expand(string_data_, test_vector); |
| 111 | boost::uuids::uuid test_uuid; |
| 112 | std::copy(test_vector.begin(), test_vector.end(), test_uuid.begin()); |
| 113 | if (uuid_data_ != test_uuid) { |
| 114 | Logger::Message(Logger::LOG_ERROR, "Internal error generating GlobalId"); |
| 115 | } |
| 116 | #endif |
| 117 | } |
| 118 | |
| 119 | IfcParse::IfcGlobalId::IfcGlobalId(const std::string& string) |
| 120 | : string_data_(string) { |