Reads an Entity from the list of Tokens at the specified offset in the file
| 584 | // Reads an Entity from the list of Tokens at the specified offset in the file |
| 585 | // |
| 586 | IfcEntityInstanceData IfcParse::impl::in_memory_file_storage::read(unsigned int i) { |
| 587 | Token datatype = tokens->Next(); |
| 588 | if (!TokenFunc::isKeyword(datatype)) { |
| 589 | throw IfcException("Unexpected token while parsing entity"); |
| 590 | } |
| 591 | const IfcParse::declaration* ty = file->schema()->declaration_by_name(TokenFunc::asStringRef(datatype)); |
| 592 | parse_context pc; |
| 593 | tokens->Next(); |
| 594 | load(i, ty->as_entity(), pc, -1); |
| 595 | return IfcEntityInstanceData(pc.construct(i, *references_to_resolve, ty, boost::none, -1)); |
| 596 | } |
| 597 | |
| 598 | void IfcParse::impl::in_memory_file_storage::try_read_semicolon() const { |
| 599 | auto old_offset = tokens->stream->tell(); |