| 94 | } |
| 95 | |
| 96 | void ConfigCommand::WriteEntryJson(std::ostream& out, const ParamEntry& entry, int indent) |
| 97 | { |
| 98 | if (entry.IsClass()) |
| 99 | { |
| 100 | const ParamClass* cls = entry.GetClassInterface(); |
| 101 | out << Indent(indent) << "\"" << JsonEscape(entry.GetName().Data()) << "\": "; |
| 102 | WriteClassJson(out, *cls, indent); |
| 103 | } |
| 104 | else if (entry.IsArray()) |
| 105 | { |
| 106 | out << Indent(indent) << "\"" << JsonEscape(entry.GetName().Data()) << "\": "; |
| 107 | WriteArrayJson(out, entry); |
| 108 | } |
| 109 | else if (entry.IsFloatValue()) |
| 110 | out << Indent(indent) << "\"" << JsonEscape(entry.GetName().Data()) << "\": " << (float)entry; |
| 111 | else if (entry.IsIntValue()) |
| 112 | out << Indent(indent) << "\"" << JsonEscape(entry.GetName().Data()) << "\": " << (int)entry; |
| 113 | else |
| 114 | out << Indent(indent) << "\"" << JsonEscape(entry.GetName().Data()) << "\": \"" |
| 115 | << JsonEscape(entry.GetValue().Data()) << "\""; |
| 116 | } |
| 117 | |
| 118 | void ConfigCommand::WriteClassJson(std::ostream& out, const ParamClass& cls, int indent) |
| 119 | { |
nothing calls this directly
no test coverage detected