summaryrefslogtreecommitdiffstats
path: root/library/cpp/yt/string/string.cpp
diff options
context:
space:
mode:
authorYDBot <[email protected]>2026-07-02 18:29:58 +0000
committerYDBot <[email protected]>2026-07-02 18:29:58 +0000
commita52ffb856a584a5099e37b9c060da3ba4a3db5fb (patch)
tree59c7f09bdc9e52d11ce6ddf8b6fabdfe1e73a8d6 /library/cpp/yt/string/string.cpp
parent6faa15e1fbe202f0fddb7c1ffe9886dc81a0425f (diff)
parentd5cfc51dd97284c59104c50bb156d1a8d9a09dac (diff)
Merge pull request #45225 from ydb-platform/merge-rightlib-260701-1735
Diffstat (limited to 'library/cpp/yt/string/string.cpp')
-rw-r--r--library/cpp/yt/string/string.cpp22
1 files changed, 21 insertions, 1 deletions
diff --git a/library/cpp/yt/string/string.cpp b/library/cpp/yt/string/string.cpp
index 1da50b4ccdd..e4a2afeca5e 100644
--- a/library/cpp/yt/string/string.cpp
+++ b/library/cpp/yt/string/string.cpp
@@ -65,6 +65,26 @@ TString CamelCaseToUnderscoreCase(TStringBuf str)
////////////////////////////////////////////////////////////////////////////////
+std::string AsciiStringToLower(TStringBuf value)
+{
+ std::string result(value.size(), '\0');
+ for (size_t index = 0; index < value.size(); ++index) {
+ result[index] = ::AsciiToLower(value[index]);
+ }
+ return result;
+}
+
+std::string AsciiStringToUpper(TStringBuf value)
+{
+ std::string result(value.size(), '\0');
+ for (size_t index = 0; index < value.size(); ++index) {
+ result[index] = ::AsciiToUpper(value[index]);
+ }
+ return result;
+}
+
+////////////////////////////////////////////////////////////////////////////////
+
[[nodiscard]] TStringBuf TrimLeadingWhitespaces(TStringBuf str Y_LIFETIME_BOUND)
{
auto begin = str.find_first_not_of(' ');
@@ -292,7 +312,7 @@ size_t TCaseInsensitiveStringHasher::operator()(TStringBuf arg) const
{
auto compute = [&] (char* buffer) {
for (size_t index = 0; index < arg.length(); ++index) {
- buffer[index] = AsciiToLower(arg[index]);
+ buffer[index] = ::AsciiToLower(arg[index]);
}
return ComputeHash(TStringBuf(buffer, arg.length()));
};