diff options
author | tobo <tobo@yandex-team.ru> | 2022-02-10 16:47:27 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:47:27 +0300 |
commit | 7fe839092527589b38f014d854c51565b3c1adfa (patch) | |
tree | 309e97022d3530044b712b8f71318c78faf7856e /library/cpp/yson/writer.cpp | |
parent | d0d68c395c10da4cb56a1c845504570a04d7893e (diff) | |
download | ydb-7fe839092527589b38f014d854c51565b3c1adfa.tar.gz |
Restoring authorship annotation for <tobo@yandex-team.ru>. Commit 1 of 2.
Diffstat (limited to 'library/cpp/yson/writer.cpp')
-rw-r--r-- | library/cpp/yson/writer.cpp | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/library/cpp/yson/writer.cpp b/library/cpp/yson/writer.cpp index 054459f9f5..43402eb506 100644 --- a/library/cpp/yson/writer.cpp +++ b/library/cpp/yson/writer.cpp @@ -15,7 +15,7 @@ namespace NYson { // Copied from <util/string/escape.cpp> namespace { - inline char HexDigit(char value) { + inline char HexDigit(char value) { Y_ASSERT(value < 16); if (value < 10) return '0' + value; @@ -23,26 +23,26 @@ namespace NYson { return 'A' + value - 10; } - inline char OctDigit(char value) { + inline char OctDigit(char value) { Y_ASSERT(value < 8); return '0' + value; } - inline bool IsPrintable(char c) { + inline bool IsPrintable(char c) { return c >= 32 && c <= 126; } - inline bool IsHexDigit(char c) { + inline bool IsHexDigit(char c) { return (c >= '0' && c <= '9') || (c >= 'A' && c <= 'F') || (c >= 'a' && c <= 'f'); } - inline bool IsOctDigit(char c) { + inline bool IsOctDigit(char c) { return c >= '0' && c <= '7'; } - const size_t ESCAPE_C_BUFFER_SIZE = 4; + const size_t ESCAPE_C_BUFFER_SIZE = 4; - inline size_t EscapeC(unsigned char c, char next, char r[ESCAPE_C_BUFFER_SIZE]) { + inline size_t EscapeC(unsigned char c, char next, char r[ESCAPE_C_BUFFER_SIZE]) { // (1) Printable characters go as-is, except backslash and double quote. // (2) Characters \r, \n, \t and \0 ... \7 replaced by their simple escape characters (if possible). // (3) Otherwise, character is encoded using hexadecimal escape sequence (if possible), or octal. @@ -114,9 +114,9 @@ namespace NYson { return ::ToString(value); } - static const TStringBuf nanLiteral = "%nan"; - static const TStringBuf infLiteral = "%inf"; - static const TStringBuf negativeInfLiteral = "%-inf"; + static const TStringBuf nanLiteral = "%nan"; + static const TStringBuf infLiteral = "%inf"; + static const TStringBuf negativeInfLiteral = "%-inf"; TStringBuf str; if (std::isnan(value)) { |