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

Method asFloat

src/ifcparse/IfcParse.cpp:431–442  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

429}
430
431double TokenFunc::asFloat(const Token& token) {
432#ifdef PERMISSIVE_FLOAT
433 if (token.type == Token_INT) {
434 /// NB: We are being more permissive here then allowed by the standard
435 return token.value_int;
436 } // ----> continues beyond preprocessor directive
437#endif
438 if (token.type == Token_FLOAT) {
439 return token.value_double;
440 }
441 throw IfcInvalidTokenException(token.startPos, toString(token), "real");
442}
443
444const std::string& TokenFunc::asStringRef(const Token& token) {
445 if (token.type == Token_NONE) {

Callers

nothing calls this directly

Calls 1

IfcInvalidTokenExceptionFunction · 0.85

Tested by

no test coverage detected