| 78 | , float_val(0.0) { } |
| 79 | |
| 80 | std::string Format() const { |
| 81 | switch (variant) { |
| 82 | case kString: |
| 83 | return "\"" + key_escaped + "\":\"" + str_val_escaped + "\""; |
| 84 | case kInteger: |
| 85 | return "\"" + key_escaped + "\":" + StringifyInt(int_val); |
| 86 | case kFloat: |
| 87 | return "\"" + key_escaped + "\":" + StringifyDouble(float_val); |
| 88 | case kJsonObject: |
| 89 | return "\"" + key_escaped + "\":" + str_val_escaped; |
| 90 | default: |
| 91 | PANIC(kLogStdout | kLogStderr, "JSON creation failed"); |
| 92 | } |
| 93 | } |
| 94 | }; |
| 95 | |
| 96 | public: |
no test coverage detected