| 689 | } |
| 690 | |
| 691 | IFC_PARSE_API IfcParse::IfcFile* IfcParse::parse_ifcxml(const std::string& filename) { |
| 692 | throw std::runtime_error("IFC-XML import temporarily disabled"); |
| 693 | |
| 694 | ifcxml_parse_state state; |
| 695 | state.file = nullptr; |
| 696 | state.dialect = ifcxml_dialect_unknown; |
| 697 | |
| 698 | xmlSAXHandler handler; |
| 699 | memset(&handler, 0, sizeof(xmlSAXHandler)); |
| 700 | handler.startElement = start_element; |
| 701 | handler.endElement = end_element; |
| 702 | handler.characters = process_characters; |
| 703 | |
| 704 | xmlSAXUserParseFile(&handler, &state, filename.c_str()); |
| 705 | |
| 706 | for (const auto& pair : state.forward_references) { |
| 707 | /* |
| 708 | auto it = state.idmap.find(pair.second); |
| 709 | if (it == state.idmap.end()) { |
| 710 | Logger::Error("Instance with id '" + pair.second + "' not encountered"); |
| 711 | } else { |
| 712 | pair.first->set(state.file->instance_by_id(it->second)); |
| 713 | } |
| 714 | */ |
| 715 | } |
| 716 | |
| 717 | if (state.file != nullptr) { |
| 718 | // state.file->parsing_complete() = true; |
| 719 | state.file->build_inverses(); |
| 720 | } |
| 721 | |
| 722 | return state.file; |
| 723 | } |
| 724 | |
| 725 | #endif // WITH_IFCXML |
no test coverage detected