diff options
author | mvel <mvel@yandex-team.ru> | 2022-02-10 16:45:41 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:45:41 +0300 |
commit | bd30392c4cc92487950adc375c07adf52da1d592 (patch) | |
tree | e8d1a3f19b7fc890bcef6e4cc5de41f1d88c9ac3 /util/string/ascii.h | |
parent | 5d50718e66d9c037dc587a0211110b7d25a66185 (diff) | |
download | ydb-bd30392c4cc92487950adc375c07adf52da1d592.tar.gz |
Restoring authorship annotation for <mvel@yandex-team.ru>. Commit 1 of 2.
Diffstat (limited to 'util/string/ascii.h')
-rw-r--r-- | util/string/ascii.h | 90 |
1 files changed, 45 insertions, 45 deletions
diff --git a/util/string/ascii.h b/util/string/ascii.h index 10344384d3..0bd70bc9ed 100644 --- a/util/string/ascii.h +++ b/util/string/ascii.h @@ -1,7 +1,7 @@ #pragma once #include <util/system/defaults.h> -#include <util/system/compat.h> +#include <util/system/compat.h> #include <util/generic/string.h> // ctype.h-like functions, locale-independent: @@ -156,72 +156,72 @@ template <class T> inline ::NPrivate::TDereferenced<T> AsciiToUpper(T c) noexcept { return IsAsciiLower(c) ? (c + ('A' - 'a')) : c; } - -/** - * ASCII case-insensitive string comparison (for proper UTF8 strings + +/** + * ASCII case-insensitive string comparison (for proper UTF8 strings * case-insensitive comparison consider using @c library/cpp/charset). * - * BUGS: Currently will NOT work properly with strings that contain - * 0-terminator character inside. See IGNIETFERRO-1641 for details. - * + * BUGS: Currently will NOT work properly with strings that contain + * 0-terminator character inside. See IGNIETFERRO-1641 for details. + * * @return true iff @c s1 ans @c s2 are case-insensitively equal. */ -static inline bool AsciiEqualsIgnoreCase(const char* s1, const char* s2) noexcept { - return stricmp(s1, s2) == 0; -} - -/** - * ASCII case-insensitive string comparison (for proper UTF8 strings +static inline bool AsciiEqualsIgnoreCase(const char* s1, const char* s2) noexcept { + return stricmp(s1, s2) == 0; +} + +/** + * ASCII case-insensitive string comparison (for proper UTF8 strings * case-insensitive comparison consider using @c library/cpp/charset). * - * BUGS: Currently will NOT work properly with strings that contain - * 0-terminator character inside. See IGNIETFERRO-1641 for details. - * + * BUGS: Currently will NOT work properly with strings that contain + * 0-terminator character inside. See IGNIETFERRO-1641 for details. + * * @return true iff @c s1 ans @c s2 are case-insensitively equal. */ static inline bool AsciiEqualsIgnoreCase(const TStringBuf s1, const TStringBuf s2) noexcept { return (s1.size() == s2.size()) && strnicmp(s1.data(), s2.data(), s1.size()) == 0; -} - -/** - * ASCII case-insensitive string comparison (for proper UTF8 strings +} + +/** + * ASCII case-insensitive string comparison (for proper UTF8 strings * case-insensitive comparison consider using @c library/cpp/charset). * - * BUGS: Currently will NOT work properly with strings that contain - * 0-terminator character inside. See IGNIETFERRO-1641 for details. - * + * BUGS: Currently will NOT work properly with strings that contain + * 0-terminator character inside. See IGNIETFERRO-1641 for details. + * * @return 0 if strings are equal, negative if @c s1 < @c s2 * and positive otherwise. * (same value as @c stricmp does). */ -static inline int AsciiCompareIgnoreCase(const char* s1, const char* s2) noexcept { - return stricmp(s1, s2); -} - -/** - * ASCII case-insensitive string comparison (for proper UTF8 strings +static inline int AsciiCompareIgnoreCase(const char* s1, const char* s2) noexcept { + return stricmp(s1, s2); +} + +/** + * ASCII case-insensitive string comparison (for proper UTF8 strings * case-insensitive comparison consider using @c library/cpp/charset). * - * BUGS: Currently will NOT work properly with strings that contain - * 0-terminator character inside. See IGNIETFERRO-1641 for details. - * - * @return - * - zero if strings are equal - * - negative if @c s1 < @c s2 - * - positive otherwise, - * similar to stricmp. + * BUGS: Currently will NOT work properly with strings that contain + * 0-terminator character inside. See IGNIETFERRO-1641 for details. + * + * @return + * - zero if strings are equal + * - negative if @c s1 < @c s2 + * - positive otherwise, + * similar to stricmp. */ Y_PURE_FUNCTION int AsciiCompareIgnoreCase(const TStringBuf s1, const TStringBuf s2) noexcept; /** - * ASCII case-sensitive string comparison (for proper UTF8 strings - * case-sensitive comparison consider using @c library/cpp/charset). - * - * BUGS: Currently will NOT work properly with strings that contain - * 0-terminator character inside. See IGNIETFERRO-1641 for details. - * - * @return true iff @c s2 are case-sensitively prefix of @c s1. - */ + * ASCII case-sensitive string comparison (for proper UTF8 strings + * case-sensitive comparison consider using @c library/cpp/charset). + * + * BUGS: Currently will NOT work properly with strings that contain + * 0-terminator character inside. See IGNIETFERRO-1641 for details. + * + * @return true iff @c s2 are case-sensitively prefix of @c s1. + */ static inline bool AsciiHasPrefix(const TStringBuf s1, const TStringBuf s2) noexcept { return (s1.size() >= s2.size()) && memcmp(s1.data(), s2.data(), s2.size()) == 0; } |