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

Method GetNoLineArguments

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

Source from the content-addressed store, hash-verified

659 }
660
661 uint32_t IfcLoader::GetNoLineArguments(uint32_t expressID) const
662 {
663 const auto lineIt = _lines.find(expressID);
664 if (lineIt == _lines.end()) return 0;
665 _tokenStream->MoveTo(lineIt->second->tapeOffset);
666 _tokenStream->Read<char>();
667 _tokenStream->Read<uint32_t>();
668 _tokenStream->Read<char>();
669 uint16_t length = _tokenStream->Read<uint16_t>();
670 _tokenStream->Forward(length);
671 _tokenStream->Read<char>();
672 uint32_t noArguments = 0;
673
674 while (true) {
675 IfcTokenType t = static_cast<IfcTokenType>(_tokenStream->Read<char>());
676 if (t == SET_END || t==LINE_END) return noArguments;
677 if (t == UNKNOWN || t==EMPTY) {
678 noArguments++;
679 continue;
680 }
681 if (t==SET_BEGIN) {
682 StepBack();
683 GetSetArgument();
684 noArguments++;
685 continue;
686
687 }
688 if (t == IfcTokenType::STRING || t == IfcTokenType::INTEGER || t == IfcTokenType::REAL || t == IfcTokenType::LABEL || t == IfcTokenType::ENUM) {
689 uint16_t length = _tokenStream->Read<uint16_t>();
690 _tokenStream->Forward(length);
691 noArguments++;
692 if (t==IfcTokenType::LABEL) GetSetArgument();
693 continue;
694 }
695 if (t == REF) {
696 _tokenStream->Read<uint32_t>();
697 noArguments++;
698 continue;
699 }
700 }
701 return noArguments;
702 }
703
704
705 void IfcLoader::MoveToArgumentOffset(const uint32_t expressID, const uint32_t argumentIndex) const

Callers

nothing calls this directly

Calls 2

MoveToMethod · 0.80
ForwardMethod · 0.45

Tested by

no test coverage detected