diff options
author | mowgli <mowgli@yandex-team.ru> | 2022-02-10 16:49:25 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:49:25 +0300 |
commit | 56c39b3cf908e7202b1f7551a1653681e8015607 (patch) | |
tree | 5d5cb817648f650d76cf1076100726fd9b8448e8 /library/cpp/json/writer/json.cpp | |
parent | 89afbbe4ca0e02e386dd4df08f7945f190dc1b84 (diff) | |
download | ydb-56c39b3cf908e7202b1f7551a1653681e8015607.tar.gz |
Restoring authorship annotation for <mowgli@yandex-team.ru>. Commit 2 of 2.
Diffstat (limited to 'library/cpp/json/writer/json.cpp')
-rw-r--r-- | library/cpp/json/writer/json.cpp | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/library/cpp/json/writer/json.cpp b/library/cpp/json/writer/json.cpp index b646d459c1..02370c2d79 100644 --- a/library/cpp/json/writer/json.cpp +++ b/library/cpp/json/writer/json.cpp @@ -28,8 +28,8 @@ namespace NJsonWriter { Stack.reserve(64); // should be enough for most cases StackPush(JE_OUTER_SPACE); - } - + } + static const char* EntityToStr(EJsonEntity e) { switch (e) { case JE_OUTER_SPACE: @@ -44,7 +44,7 @@ namespace NJsonWriter { return "JE_unknown"; } } - + inline void TBuf::StackPush(EJsonEntity e) { Stack.push_back(e); } @@ -74,7 +74,7 @@ namespace NJsonWriter { NeedComma = true; NeedNewline = true; } - + inline void TBuf::CheckAndPop(EJsonEntity e) { if (Y_UNLIKELY(StackTop() != e)) { ythrow TError() << "JSON writer: unexpected value " @@ -91,8 +91,8 @@ namespace NJsonWriter { return; PrintWhitespaces(Max(0, indentation), true); - } - + } + void TBuf::PrintWhitespaces(size_t count, bool prependWithNewLine) { static constexpr TStringBuf whitespacesTemplate = "\n "; static_assert(whitespacesTemplate[0] == '\n'); @@ -112,13 +112,13 @@ namespace NJsonWriter { RawWriteChar(','); } NeedComma = true; - + if (NeedNewline) { PrintIndentation(false); } NeedNewline = true; } - + inline void TBuf::BeginValue() { if (Y_UNLIKELY(KeyExpected())) { ythrow TError() << "JSON writer: value written, " @@ -375,9 +375,9 @@ namespace NJsonWriter { return false; } - -#undef MATCH - + +#undef MATCH + static bool LessStrPtr(const TString* a, const TString* b) { return *a < *b; } |