diff options
author | somov <somov@yandex-team.ru> | 2022-02-10 16:45:47 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:45:47 +0300 |
commit | a5950576e397b1909261050b8c7da16db58f10b1 (patch) | |
tree | 7ba7677f6a4c3e19e2cefab34d16df2c8963b4d4 /contrib/restricted/abseil-cpp-tstring/y_absl/strings/strip.h | |
parent | 81eddc8c0b55990194e112b02d127b87d54164a9 (diff) | |
download | ydb-a5950576e397b1909261050b8c7da16db58f10b1.tar.gz |
Restoring authorship annotation for <somov@yandex-team.ru>. Commit 1 of 2.
Diffstat (limited to 'contrib/restricted/abseil-cpp-tstring/y_absl/strings/strip.h')
-rw-r--r-- | contrib/restricted/abseil-cpp-tstring/y_absl/strings/strip.h | 40 |
1 files changed, 20 insertions, 20 deletions
diff --git a/contrib/restricted/abseil-cpp-tstring/y_absl/strings/strip.h b/contrib/restricted/abseil-cpp-tstring/y_absl/strings/strip.h index 3164ff1ebc..32558b3809 100644 --- a/contrib/restricted/abseil-cpp-tstring/y_absl/strings/strip.h +++ b/contrib/restricted/abseil-cpp-tstring/y_absl/strings/strip.h @@ -24,12 +24,12 @@ #include <cstddef> #include <util/generic/string.h> -#include "y_absl/base/macros.h" -#include "y_absl/strings/ascii.h" -#include "y_absl/strings/match.h" -#include "y_absl/strings/string_view.h" +#include "y_absl/base/macros.h" +#include "y_absl/strings/ascii.h" +#include "y_absl/strings/match.h" +#include "y_absl/strings/string_view.h" -namespace y_absl { +namespace y_absl { ABSL_NAMESPACE_BEGIN // ConsumePrefix() @@ -39,11 +39,11 @@ ABSL_NAMESPACE_BEGIN // // Example: // -// y_absl::string_view input("abc"); -// EXPECT_TRUE(y_absl::ConsumePrefix(&input, "a")); +// y_absl::string_view input("abc"); +// EXPECT_TRUE(y_absl::ConsumePrefix(&input, "a")); // EXPECT_EQ(input, "bc"); -inline bool ConsumePrefix(y_absl::string_view* str, y_absl::string_view expected) { - if (!y_absl::StartsWith(*str, expected)) return false; +inline bool ConsumePrefix(y_absl::string_view* str, y_absl::string_view expected) { + if (!y_absl::StartsWith(*str, expected)) return false; str->remove_prefix(expected.size()); return true; } @@ -54,11 +54,11 @@ inline bool ConsumePrefix(y_absl::string_view* str, y_absl::string_view expected // // Example: // -// y_absl::string_view input("abcdef"); -// EXPECT_TRUE(y_absl::ConsumeSuffix(&input, "def")); +// y_absl::string_view input("abcdef"); +// EXPECT_TRUE(y_absl::ConsumeSuffix(&input, "def")); // EXPECT_EQ(input, "abc"); -inline bool ConsumeSuffix(y_absl::string_view* str, y_absl::string_view expected) { - if (!y_absl::EndsWith(*str, expected)) return false; +inline bool ConsumeSuffix(y_absl::string_view* str, y_absl::string_view expected) { + if (!y_absl::EndsWith(*str, expected)) return false; str->remove_suffix(expected.size()); return true; } @@ -68,9 +68,9 @@ inline bool ConsumeSuffix(y_absl::string_view* str, y_absl::string_view expected // Returns a view into the input string 'str' with the given 'prefix' removed, // but leaving the original string intact. If the prefix does not match at the // start of the string, returns the original string instead. -ABSL_MUST_USE_RESULT inline y_absl::string_view StripPrefix( - y_absl::string_view str, y_absl::string_view prefix) { - if (y_absl::StartsWith(str, prefix)) str.remove_prefix(prefix.size()); +ABSL_MUST_USE_RESULT inline y_absl::string_view StripPrefix( + y_absl::string_view str, y_absl::string_view prefix) { + if (y_absl::StartsWith(str, prefix)) str.remove_prefix(prefix.size()); return str; } @@ -79,13 +79,13 @@ ABSL_MUST_USE_RESULT inline y_absl::string_view StripPrefix( // Returns a view into the input string 'str' with the given 'suffix' removed, // but leaving the original string intact. If the suffix does not match at the // end of the string, returns the original string instead. -ABSL_MUST_USE_RESULT inline y_absl::string_view StripSuffix( - y_absl::string_view str, y_absl::string_view suffix) { - if (y_absl::EndsWith(str, suffix)) str.remove_suffix(suffix.size()); +ABSL_MUST_USE_RESULT inline y_absl::string_view StripSuffix( + y_absl::string_view str, y_absl::string_view suffix) { + if (y_absl::EndsWith(str, suffix)) str.remove_suffix(suffix.size()); return str; } ABSL_NAMESPACE_END -} // namespace y_absl +} // namespace y_absl #endif // ABSL_STRINGS_STRIP_H_ |