| 925 | } |
| 926 | |
| 927 | void JSONFormattable::encode_json(const char *name, Formatter *f) const |
| 928 | { |
| 929 | switch (type) { |
| 930 | case JSONFormattable::FMT_VALUE: |
| 931 | ::encode_json(name, value, f); |
| 932 | break; |
| 933 | case JSONFormattable::FMT_ARRAY: |
| 934 | ::encode_json(name, arr, f); |
| 935 | break; |
| 936 | case JSONFormattable::FMT_OBJ: |
| 937 | f->open_object_section(name); |
| 938 | for (auto iter : obj) { |
| 939 | ::encode_json(iter.first.c_str(), iter.second, f); |
| 940 | } |
| 941 | f->close_section(); |
| 942 | break; |
| 943 | case JSONFormattable::FMT_NONE: |
| 944 | break; |
| 945 | } |
| 946 | } |
| 947 | |
| 948 | bool JSONFormattable::handle_value(std::string_view name, std::string_view s, bool quoted) { |
| 949 | JSONFormattable *new_val; |
no test coverage detected