diff options
author | a-square <a-square@yandex-team.ru> | 2022-02-10 16:50:24 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:50:24 +0300 |
commit | a01c1f7b71b4422f01b11d9ea45bfd88e228c968 (patch) | |
tree | 5d5cb817648f650d76cf1076100726fd9b8448e8 /util/string | |
parent | 34f3f9bd7972f67d913075206081554a3e39a0de (diff) | |
download | ydb-a01c1f7b71b4422f01b11d9ea45bfd88e228c968.tar.gz |
Restoring authorship annotation for <a-square@yandex-team.ru>. Commit 2 of 2.
Diffstat (limited to 'util/string')
-rw-r--r-- | util/string/ascii.cpp | 12 | ||||
-rw-r--r-- | util/string/ascii.h | 22 | ||||
-rw-r--r-- | util/string/ascii_ut.cpp | 6 |
3 files changed, 20 insertions, 20 deletions
diff --git a/util/string/ascii.cpp b/util/string/ascii.cpp index c092e29965..95edb95cc8 100644 --- a/util/string/ascii.cpp +++ b/util/string/ascii.cpp @@ -7,12 +7,12 @@ extern const unsigned char NPrivate::ASCII_CLASS[256] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x01, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, - 0x68, 0x68, 0x68, 0x68, 0x68, 0x68, 0x68, 0x68, 0x68, 0x68, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, - 0x80, 0x72, 0x72, 0x72, 0x72, 0x72, 0x72, 0x32, 0x32, 0x32, 0x32, 0x32, 0x32, 0x32, 0x32, 0x32, - 0x32, 0x32, 0x32, 0x32, 0x32, 0x32, 0x32, 0x32, 0x32, 0x32, 0x32, 0x80, 0x80, 0x80, 0x80, 0x80, - 0x80, 0x74, 0x74, 0x74, 0x74, 0x74, 0x74, 0x34, 0x34, 0x34, 0x34, 0x34, 0x34, 0x34, 0x34, 0x34, - 0x34, 0x34, 0x34, 0x34, 0x34, 0x34, 0x34, 0x34, 0x34, 0x34, 0x34, 0x80, 0x80, 0x80, 0x80, 0x00, + 0x01, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, + 0x68, 0x68, 0x68, 0x68, 0x68, 0x68, 0x68, 0x68, 0x68, 0x68, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, + 0x80, 0x72, 0x72, 0x72, 0x72, 0x72, 0x72, 0x32, 0x32, 0x32, 0x32, 0x32, 0x32, 0x32, 0x32, 0x32, + 0x32, 0x32, 0x32, 0x32, 0x32, 0x32, 0x32, 0x32, 0x32, 0x32, 0x32, 0x80, 0x80, 0x80, 0x80, 0x80, + 0x80, 0x74, 0x74, 0x74, 0x74, 0x74, 0x74, 0x34, 0x34, 0x34, 0x34, 0x34, 0x34, 0x34, 0x34, 0x34, + 0x34, 0x34, 0x34, 0x34, 0x34, 0x34, 0x34, 0x34, 0x34, 0x34, 0x34, 0x80, 0x80, 0x80, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, diff --git a/util/string/ascii.h b/util/string/ascii.h index 602938811d..10344384d3 100644 --- a/util/string/ascii.h +++ b/util/string/ascii.h @@ -19,8 +19,8 @@ namespace NPrivate { CC_DIGIT = 8, CC_ALPHA = 16, CC_ALNUM = 32, - CC_ISHEX = 64, - CC_PUNCT = 128, + CC_ISHEX = 64, + CC_PUNCT = 128, }; extern const unsigned char ASCII_CLASS[256]; @@ -92,10 +92,10 @@ inline bool IsAsciiHex(unsigned char c) { return ::NPrivate::ASCII_CLASS[c] & ::NPrivate::CC_ISHEX; } -inline bool IsAsciiPunct(unsigned char c) { - return ::NPrivate::ASCII_CLASS[c] & ::NPrivate::CC_PUNCT; -} - +inline bool IsAsciiPunct(unsigned char c) { + return ::NPrivate::ASCII_CLASS[c] & ::NPrivate::CC_PUNCT; +} + // some overloads template <class T> @@ -133,11 +133,11 @@ inline bool IsAsciiHex(T c) { return ::NPrivate::RangeOk(c) && IsAsciiHex(static_cast<unsigned char>(c)); } -template <class T> -inline bool IsAsciiPunct(T c) { - return ::NPrivate::RangeOk(c) && IsAsciiPunct(static_cast<unsigned char>(c)); -} - +template <class T> +inline bool IsAsciiPunct(T c) { + return ::NPrivate::RangeOk(c) && IsAsciiPunct(static_cast<unsigned char>(c)); +} + // some extra helpers inline ui8 AsciiToLower(ui8 c) noexcept { return ::NPrivate::ASCII_LOWER[c]; diff --git a/util/string/ascii_ut.cpp b/util/string/ascii_ut.cpp index 17ac6029d9..89069fee50 100644 --- a/util/string/ascii_ut.cpp +++ b/util/string/ascii_ut.cpp @@ -34,7 +34,7 @@ Y_UNIT_TEST_SUITE(TAsciiTest) { UNIT_ASSERT_VALUES_EQUAL((bool)isupper(i), IsAsciiUpper((char)i)); UNIT_ASSERT_VALUES_EQUAL((bool)islower(i), IsAsciiLower((char)i)); UNIT_ASSERT_VALUES_EQUAL((bool)isdigit(i), IsAsciiDigit((char)i)); - UNIT_ASSERT_VALUES_EQUAL((bool)ispunct(i), IsAsciiPunct((char)i)); + UNIT_ASSERT_VALUES_EQUAL((bool)ispunct(i), IsAsciiPunct((char)i)); } } @@ -47,7 +47,7 @@ Y_UNIT_TEST_SUITE(TAsciiTest) { UNIT_ASSERT(!IsAsciiUpper(i)); UNIT_ASSERT(!IsAsciiLower(i)); UNIT_ASSERT(!IsAsciiDigit(i)); - UNIT_ASSERT(!IsAsciiPunct(i)); + UNIT_ASSERT(!IsAsciiPunct(i)); } for (int i = -1000; i < 0; ++i) { @@ -58,7 +58,7 @@ Y_UNIT_TEST_SUITE(TAsciiTest) { UNIT_ASSERT(!IsAsciiUpper(i)); UNIT_ASSERT(!IsAsciiLower(i)); UNIT_ASSERT(!IsAsciiDigit(i)); - UNIT_ASSERT(!IsAsciiPunct(i)); + UNIT_ASSERT(!IsAsciiPunct(i)); } } |