MCPcopy Create free account
hub / github.com/catboost/catboost / OpenComplexValue

Method OpenComplexValue

library/cpp/json/ordered_maps/json_reader_ordered.cpp:25–45  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

23 static const size_t DEFAULT_BUFFER_LEN = 65536;
24
25 bool TParserCallbacks::OpenComplexValue(EJsonValueType type) {
26 TJsonValue* pvalue;
27 switch (CurrentState) {
28 case START:
29 Value.SetType(type);
30 ValuesStack.push_back(&Value);
31 break;
32 case IN_ARRAY:
33 pvalue = &ValuesStack.back()->AppendValue(type);
34 ValuesStack.push_back(pvalue);
35 break;
36 case AFTER_MAP_KEY:
37 pvalue = &ValuesStack.back()->InsertValue(Key, type);
38 ValuesStack.push_back(pvalue);
39 CurrentState = IN_MAP;
40 break;
41 default:
42 return false;
43 }
44 return true;
45 }
46
47 bool TParserCallbacks::CloseComplexValue() {
48 if (ValuesStack.empty()) {

Callers

nothing calls this directly

Calls 4

AppendValueMethod · 0.80
SetTypeMethod · 0.45
push_backMethod · 0.45
backMethod · 0.45

Tested by

no test coverage detected