MCPcopy Create free account
hub / github.com/baldurk/renderdoc / valueString

Function valueString

renderdoc/core/settings.cpp:35–56  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

33static const rdcliteral debugOnlyString = "DEBUG VARIABLE: Read-only in stable builds."_lit;
34
35static rdcstr valueString(const SDObject *o)
36{
37 if(o->type.basetype == SDBasic::String)
38 return o->data.str;
39
40 if(o->type.basetype == SDBasic::UnsignedInteger)
41 return StringFormat::Fmt("%llu", o->data.basic.u);
42
43 if(o->type.basetype == SDBasic::SignedInteger)
44 return StringFormat::Fmt("%lld", o->data.basic.i);
45
46 if(o->type.basetype == SDBasic::Float)
47 return StringFormat::Fmt("%lf", o->data.basic.d);
48
49 if(o->type.basetype == SDBasic::Boolean)
50 return o->data.basic.b ? "True" : "False";
51
52 if(o->type.basetype == SDBasic::Array)
53 return StringFormat::Fmt("[%zu]", o->NumChildren());
54
55 return "{}";
56}
57
58struct xml_stream_writer : pugi::xml_writer
59{

Callers 1

MergeConfigValuesFunction · 0.70

Calls 1

FmtFunction · 0.85

Tested by

no test coverage detected