MCPcopy Create free account
hub / github.com/IfcOpenShell/IfcOpenShell / end_element

Function end_element

src/ifcparse/parse_ifcxml.cpp:264–301  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

262}
263
264static void end_element(void* user, const xmlChar* tag) {
265 ifcxml_parse_state* state = (ifcxml_parse_state*)user;
266
267 if (state->file == nullptr) {
268 return;
269 }
270
271 if (!state->stack.empty() && state->stack.back().ntype() == stack_node::node_aggregate) {
272 const auto& back = state->stack.back();
273 auto& elems = state->stack.back().aggregate_elements;
274 /*
275 auto* list = new IfcParse::ArgumentList(elems.size());
276 size_t i = 0;
277 for (auto& elem : elems) {
278 list->arguments()[i++] = elem;
279 }
280 */
281 // @todo
282 // back.inst()->set_attribute_value(back.idx(), elems);
283 }
284
285 if (state->dialect == ifcxml_dialect_ifc2x3 && state->stack.back().ntype() == stack_node::node_instance) {
286 if (state->stack.back().inst() != nullptr) {
287 state->idmap[state->stack.back().id()] = state->file->addEntity(state->stack.back().inst())->id();
288 }
289 }
290
291 const std::string tagname = (char*)tag;
292
293 // ignore uos ex:iso_10303_28 (ifc2x3) and ifc:ifcXML (ifc4)
294 if (tagname != "uos" && tagname != "ex:iso_10303_28" && tagname != "ifc:ifcXML" && tagname != "ifcXML") {
295 if (state->stack.empty()) {
296 Logger::Error("Mismatch in parse stack due to previous errors");
297 } else {
298 state->stack.pop_back();
299 }
300 }
301}
302
303static void process_characters(void* user, const xmlChar* character, int len) {
304 ifcxml_parse_state* state = (ifcxml_parse_state*)user;

Callers

nothing calls this directly

Calls 6

ntypeMethod · 0.80
instMethod · 0.80
addEntityMethod · 0.80
ErrorFunction · 0.70
emptyMethod · 0.45
idMethod · 0.45

Tested by

no test coverage detected