MCPcopy Create free account
hub / github.com/bcndev/bytecoin / read_array

Method read_array

src/common/JsonValue.cpp:922–943  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

920}
921
922void JsonValue::read_array(size_t level, StreamContext &ctx) {
923 if (level > 100)
924 ctx.throw_error("Depth too big");
925 JsonValue::Array value;
926 char c = ctx.peek_non_ws_char();
927
928 if (c == ']')
929 ctx.read_non_ws_char();
930 else {
931 for (;;) {
932 value.resize(value.size() + 1);
933 value.back().read_json(level, ctx);
934 c = ctx.read_non_ws_char();
935
936 if (c == ']')
937 break;
938 ctx.expect(c, ',');
939 }
940 }
941
942 *this = std::move(value);
943}
944
945void JsonValue::read_true(StreamContext &ctx) {
946 char data[3]{ctx.read_char(), ctx.read_char(), ctx.read_char()};

Callers

nothing calls this directly

Calls 6

peek_non_ws_charMethod · 0.80
read_non_ws_charMethod · 0.80
read_jsonMethod · 0.80
expectMethod · 0.80
throw_errorMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected