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

Method toString

src/ifcparse/IfcParse.cpp:497–519  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

495}
496
497std::string TokenFunc::toString(const Token& token) {
498 std::string result;
499 if (token.type == Token_OPERATOR) {
500 result.push_back(token.value_char);
501 } else if (token.type == Token_INT) {
502 result = std::to_string(token.value_int);
503 } else if (token.type == Token_BOOL) {
504 if (token.value_int == 1) {
505 result = ".T.";
506 } else if (token.value_int == 0) {
507 result = ".F.";
508 } else {
509 result = ".U.";
510 }
511 } else if (token.type == Token_FLOAT) {
512 std::ostringstream oss;
513 oss << std::setprecision(15) << token.value_double;
514 result = oss.str();
515 } else {
516 token.lexer->TokenString(token.startPos, result);
517 }
518 return result;
519}
520
521//
522// Reads the arguments from a list of token

Callers 11

printMethod · 0.80
plain_text_messageFunction · 0.80
json_messageFunction · 0.80
writeMethod · 0.80
operator()Method · 0.80
IfcParse.cppFile · 0.80
fix_spaceboundariesFunction · 0.80
fix_wallconnectivityFunction · 0.80
mainFunction · 0.80
lightenColorMethod · 0.80

Calls 15

to_stringFunction · 0.85
apply_visitorFunction · 0.85
get_schemaFunction · 0.85
idFunction · 0.85
push_backMethod · 0.80
TokenStringMethod · 0.80
derivedMethod · 0.80
declarationClass · 0.70
identityFunction · 0.70
visitFunction · 0.50
strMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected