MCPcopy Create free account
hub / github.com/ceph/ceph / encode_json

Method encode_json

src/common/ceph_json.cc:927–946  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

925}
926
927void 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
948bool JSONFormattable::handle_value(std::string_view name, std::string_view s, bool quoted) {
949 JSONFormattable *new_val;

Callers 1

encode_jsonFunction · 0.45

Calls 4

encode_jsonFunction · 0.70
open_object_sectionMethod · 0.45
c_strMethod · 0.45
close_sectionMethod · 0.45

Tested by

no test coverage detected