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

Method EnterNode

library/cpp/yson/json/json_writer.cpp:53–75  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

51 }
52
53 void TJsonWriter::EnterNode() {
54 if (AttributesMode == JAM_NEVER) {
55 HasAttributes = false;
56 } else if (AttributesMode == JAM_ON_DEMAND) {
57 // Do nothing
58 } else if (AttributesMode == JAM_ALWAYS) {
59 if (!HasAttributes) {
60 JsonWriter->OpenMap();
61 JsonWriter->Write("$attributes");
62 JsonWriter->OpenMap();
63 JsonWriter->CloseMap();
64 }
65 HasAttributes = true;
66 }
67 HasUnfoldedStructureStack.push_back(HasAttributes);
68
69 if (HasAttributes) {
70 JsonWriter->Write("$value");
71 HasAttributes = false;
72 }
73
74 Depth += 1;
75 }
76
77 void TJsonWriter::LeaveNode() {
78 Y_ASSERT(!HasUnfoldedStructureStack.empty());

Callers

nothing calls this directly

Calls 4

OpenMapMethod · 0.45
WriteMethod · 0.45
CloseMapMethod · 0.45
push_backMethod · 0.45

Tested by

no test coverage detected