| 1187 | } |
| 1188 | |
| 1189 | bool IfcParse::IfcFile::initialize(const std::string& fn, bool mmap) { |
| 1190 | std::unique_ptr<FileReader> s; |
| 1191 | if (mmap) { |
| 1192 | s = std::make_unique<FileReader>(fn, FileReader::mmap_tag{}); |
| 1193 | } else { |
| 1194 | s = std::make_unique<FileReader>(fn); |
| 1195 | } |
| 1196 | |
| 1197 | storage_.emplace<1>(this); |
| 1198 | std::get<impl::in_memory_file_storage>(storage_).read_from_stream(&*s, schema_, max_id_, types_to_bypass_loading_); |
| 1199 | |
| 1200 | if ((good_ = std::get<impl::in_memory_file_storage>(storage_).good_)) { |
| 1201 | // @todo unify these names, it's already confusing enough as it stands |
| 1202 | byid_ = decltype(byid_)(&std::get<impl::in_memory_file_storage>(storage_).byid_); |
| 1203 | byref_excl_ = decltype(byref_excl_)(&std::get<impl::in_memory_file_storage>(storage_).byref_excl_); |
| 1204 | byguid_ = decltype(byguid_)(&std::get<impl::in_memory_file_storage>(storage_).byguid_); |
| 1205 | } |
| 1206 | |
| 1207 | ifcroot_type_ = schema_ ? schema_->declaration_by_name("IfcRoot") : nullptr; |
| 1208 | return good_ == file_open_status::SUCCESS; |
| 1209 | } |
| 1210 | #endif |
| 1211 | |
| 1212 | IfcFile::IfcFile(const uninitialized_tag&) |
no test coverage detected