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

Function ReadValue

src/cpp/test/web-ifc-test.cpp:147–179  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

145}
146
147std::string ReadValue(webifc::parsing::IfcLoader &loader, webifc::parsing::IfcTokenType t)
148{
149 switch (t)
150 {
151 case webifc::parsing::IfcTokenType::STRING:
152 {
153 return loader.GetDecodedStringArgument();
154 }
155 case webifc::parsing::IfcTokenType::ENUM:
156 {
157 std::string_view s = loader.GetStringArgument();
158 return std::string(s);
159 }
160 case webifc::parsing::IfcTokenType::REAL:
161 {
162 std::string_view s = loader.GetDoubleArgumentAsString();
163 return std::string(s);
164 }
165 case webifc::parsing::IfcTokenType::INTEGER:
166 {
167 long d = loader.GetIntArgument();
168 return std::to_string(d);
169 }
170 case webifc::parsing::IfcTokenType::REF:
171 {
172 uint32_t ref = loader.GetRefArgument();
173 return std::to_string(ref);
174 }
175 default:
176 // use undefined to signal val parse issue
177 return "";
178 }
179}
180
181std::string GetArgs(webifc::parsing::IfcLoader &loader, bool inObject = false, bool inList = false)
182{

Callers 1

GetArgsFunction · 0.70

Calls 5

GetStringArgumentMethod · 0.80
GetIntArgumentMethod · 0.80
GetRefArgumentMethod · 0.80

Tested by

no test coverage detected