MCPcopy Create free account
hub / github.com/ObEngine/ObEngine / dump

Method dump

extlibs/vili/src/node.cpp:263–279  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

261 }
262
263 std::string node::dump(bool root) const
264 {
265 if (is_null())
266 return "";
267 if (is<number>())
268 return utils::string::truncate_float(std::to_string(as<number>()));
269 if (is<integer>())
270 return std::to_string(as<integer>());
271 if (is<string>())
272 return utils::string::quote(as<string>());
273 if (is<boolean>())
274 return (as<boolean>() ? "true" : "false");
275 if (is<array>())
276 return dump_array();
277 if (is<object>())
278 return dump_object(root);
279 }
280
281 bool node::is_primitive() const
282 {

Callers 3

dump_arrayMethod · 0.45
dump_objectMethod · 0.45
node.cppFile · 0.45

Calls 3

truncate_floatFunction · 0.85
to_stringFunction · 0.70
quoteFunction · 0.70

Tested by

no test coverage detected