diff options
author | Anton Samokhvalov <pg83@yandex.ru> | 2022-02-10 16:45:17 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:45:17 +0300 |
commit | d3a398281c6fd1d3672036cb2d63f842d2cb28c5 (patch) | |
tree | dd4bd3ca0f36b817e96812825ffaf10d645803f2 /library/cpp/json/fast_sax | |
parent | 72cb13b4aff9bc9cf22e49251bc8fd143f82538f (diff) | |
download | ydb-d3a398281c6fd1d3672036cb2d63f842d2cb28c5.tar.gz |
Restoring authorship annotation for Anton Samokhvalov <pg83@yandex.ru>. Commit 2 of 2.
Diffstat (limited to 'library/cpp/json/fast_sax')
-rw-r--r-- | library/cpp/json/fast_sax/parser.h | 22 | ||||
-rw-r--r-- | library/cpp/json/fast_sax/parser.rl6 | 14 | ||||
-rw-r--r-- | library/cpp/json/fast_sax/unescape.cpp | 12 | ||||
-rw-r--r-- | library/cpp/json/fast_sax/unescape.h | 10 | ||||
-rw-r--r-- | library/cpp/json/fast_sax/ya.make | 24 |
5 files changed, 41 insertions, 41 deletions
diff --git a/library/cpp/json/fast_sax/parser.h b/library/cpp/json/fast_sax/parser.h index 31f5348da9..b5f031dd9e 100644 --- a/library/cpp/json/fast_sax/parser.h +++ b/library/cpp/json/fast_sax/parser.h @@ -1,13 +1,13 @@ -#pragma once - +#pragma once + #include <library/cpp/json/common/defs.h> - -namespace NJson { - bool ReadJsonFast(TStringBuf in, TJsonCallbacks* callbacks); - - inline bool ValidateJsonFast(TStringBuf in, bool throwOnError = false) { + +namespace NJson { + bool ReadJsonFast(TStringBuf in, TJsonCallbacks* callbacks); + + inline bool ValidateJsonFast(TStringBuf in, bool throwOnError = false) { Y_ASSERT(false); // this method is broken, see details in IGNIETFERRO-1243. Use NJson::ValidateJson instead, or fix this one before using - TJsonCallbacks c(throwOnError); - return ReadJsonFast(in, &c); - } -} + TJsonCallbacks c(throwOnError); + return ReadJsonFast(in, &c); + } +} diff --git a/library/cpp/json/fast_sax/parser.rl6 b/library/cpp/json/fast_sax/parser.rl6 index 0f1ad3b3b1..edb4e9ee1b 100644 --- a/library/cpp/json/fast_sax/parser.rl6 +++ b/library/cpp/json/fast_sax/parser.rl6 @@ -2,7 +2,7 @@ #include <library/cpp/json/fast_sax/parser.h> #include <util/string/cast.h> -#include <util/generic/buffer.h> +#include <util/generic/buffer.h> #include <util/generic/strbuf.h> #include <util/generic/ymath.h> @@ -15,7 +15,7 @@ enum EStoredStr { struct TParserCtx { TJsonCallbacks& Hndl; - TBuffer Buffer; + TBuffer Buffer; TStringBuf String; EStoredStr Stored = SS_NONE; bool ExpectValue = true; @@ -142,9 +142,9 @@ struct TParserCtx { } bool OnStrE() { - Buffer.Clear(); - Buffer.Reserve(2 * (te - ts)); - + Buffer.Clear(); + Buffer.Reserve(2 * (te - ts)); + return OnString(UnescapeJsonUnicode(TStringBuf(ts + 1, te - ts - 2), Buffer.data()), SS_MUSTCOPY); } @@ -170,8 +170,8 @@ struct TParserCtx { Stored = SS_NONE; switch (stored) { - default: - return false; + default: + return false; case SS_NOCOPY: return Hndl.OnMapKeyNoCopy(String); case SS_MUSTCOPY: diff --git a/library/cpp/json/fast_sax/unescape.cpp b/library/cpp/json/fast_sax/unescape.cpp index 772fe92a0d..72109b0b5e 100644 --- a/library/cpp/json/fast_sax/unescape.cpp +++ b/library/cpp/json/fast_sax/unescape.cpp @@ -1,7 +1,7 @@ -#include "unescape.h" - -#include <util/string/escape.h> - -TStringBuf UnescapeJsonUnicode(TStringBuf data, char* scratch) { +#include "unescape.h" + +#include <util/string/escape.h> + +TStringBuf UnescapeJsonUnicode(TStringBuf data, char* scratch) { return TStringBuf(scratch, UnescapeC(data.data(), data.size(), scratch)); -} +} diff --git a/library/cpp/json/fast_sax/unescape.h b/library/cpp/json/fast_sax/unescape.h index 55315548bc..5e40e1e866 100644 --- a/library/cpp/json/fast_sax/unescape.h +++ b/library/cpp/json/fast_sax/unescape.h @@ -1,5 +1,5 @@ -#pragma once - -#include <util/generic/strbuf.h> - -TStringBuf UnescapeJsonUnicode(TStringBuf data, char* scratch); +#pragma once + +#include <util/generic/strbuf.h> + +TStringBuf UnescapeJsonUnicode(TStringBuf data, char* scratch); diff --git a/library/cpp/json/fast_sax/ya.make b/library/cpp/json/fast_sax/ya.make index 46e5c7c5d9..c6447ab6ac 100644 --- a/library/cpp/json/fast_sax/ya.make +++ b/library/cpp/json/fast_sax/ya.make @@ -1,17 +1,17 @@ -LIBRARY() - +LIBRARY() + OWNER( pg velavokr ) - -PEERDIR( + +PEERDIR( library/cpp/json/common -) - -SRCS( - parser.rl6 - unescape.cpp -) - -END() +) + +SRCS( + parser.rl6 + unescape.cpp +) + +END() |