MCPcopy Create free account
hub / github.com/BohemiaInteractive/CWR / WriteArrayValueJson

Method WriteArrayValueJson

apps/tools/Tools/commands/ConfigCommand.cpp:63–82  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

61}
62
63void ConfigCommand::WriteArrayValueJson(std::ostream& out, const IParamArrayValue& val)
64{
65 if (val.IsArrayValue())
66 {
67 out << "[";
68 for (int i = 0; i < val.GetItemCount(); i++)
69 {
70 if (i > 0)
71 out << ", ";
72 WriteArrayValueJson(out, val[i]);
73 }
74 out << "]";
75 }
76 else if (val.IsFloatValue())
77 out << val.GetFloat();
78 else if (val.IsIntValue())
79 out << val.GetInt();
80 else
81 out << "\"" << JsonEscape(val.GetValue().Data()) << "\"";
82}
83
84void ConfigCommand::WriteArrayJson(std::ostream& out, const ParamEntry& entry)
85{

Callers

nothing calls this directly

Calls 9

JsonEscapeFunction · 0.70
IsArrayValueMethod · 0.45
GetItemCountMethod · 0.45
IsFloatValueMethod · 0.45
GetFloatMethod · 0.45
IsIntValueMethod · 0.45
GetIntMethod · 0.45
DataMethod · 0.45
GetValueMethod · 0.45

Tested by

no test coverage detected