MCPcopy Create free account
hub / github.com/ThatOpen/engine_web-ifc / ArgumentOffset

Method ArgumentOffset

src/cpp/web-ifc/parsing/IfcLoader.cpp:602–659  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

600 }
601
602 void IfcLoader::ArgumentOffset(const uint32_t argumentIndex) const
603 {
604 uint32_t movedOver = 0;
605 uint32_t setDepth = 0;
606 while (true)
607 {
608 if (setDepth == 1)
609 {
610 movedOver++;
611
612 if (movedOver-1 == argumentIndex)
613 {
614 return;
615 }
616 }
617
618 IfcTokenType t = static_cast<IfcTokenType>(_tokenStream->Read<char>());
619
620 switch (t)
621 {
622 case IfcTokenType::LINE_END:
623 {
624 spdlog::error("[ArgumentOffset()] unexpected line end {}", GetCurrentLineExpressID());
625 break;
626 }
627 case IfcTokenType::UNKNOWN:
628 case IfcTokenType::EMPTY:
629 break;
630 case IfcTokenType::SET_BEGIN:
631 setDepth++;
632 break;
633 case IfcTokenType::SET_END:
634 setDepth--;
635 if (setDepth == 0)
636 {
637 return;
638 }
639 break;
640 case IfcTokenType::STRING:
641 case IfcTokenType::ENUM:
642 case IfcTokenType::LABEL:
643 case IfcTokenType::INTEGER:
644 case IfcTokenType::REAL:
645 {
646 uint16_t length = _tokenStream->Read<uint16_t>();
647 _tokenStream->Forward(length);
648 break;
649 }
650 case IfcTokenType::REF:
651 {
652 _tokenStream->Read<uint32_t>();
653 break;
654 }
655 default:
656 break;
657 }
658 }
659 }

Callers

nothing calls this directly

Calls 2

errorFunction · 0.85
ForwardMethod · 0.45

Tested by

no test coverage detected