From 63b4956c3a802ee1c0fd92d1ce56e9330b6de4d2 Mon Sep 17 00:00:00 2001 From: crupest Date: Sun, 14 Nov 2021 22:44:59 +0800 Subject: ... --- src/common/String.cpp | 13 +++++++++++++ src/common/StringUtil.cpp | 12 ------------ 2 files changed, 13 insertions(+), 12 deletions(-) (limited to 'src/common') diff --git a/src/common/String.cpp b/src/common/String.cpp index 8b53b16b..743a33fd 100644 --- a/src/common/String.cpp +++ b/src/common/String.cpp @@ -376,4 +376,17 @@ StringView StringView::substr(Index pos, Index size) { return StringView(ptr_ + pos, std::min(size, size_ - pos)); } +std::string StringView::ToUtf8() const { return cru::ToUtf8(ptr_, size_); } + +String ToLower(StringView s) { + String result; + for (auto c : s) result.push_back(ToLower(c)); + return result; +} + +String ToUpper(StringView s) { + String result; + for (auto c : s) result.push_back(ToUpper(c)); + return result; +} } // namespace cru diff --git a/src/common/StringUtil.cpp b/src/common/StringUtil.cpp index 850524b5..c828fa21 100644 --- a/src/common/StringUtil.cpp +++ b/src/common/StringUtil.cpp @@ -252,16 +252,4 @@ char16_t ToUpper(char16_t c) { } return c; } - -std::u16string ToLower(std::u16string_view s) { - std::u16string result; - for (auto c : s) result.push_back(ToLower(c)); - return result; -} - -std::u16string ToUpper(std::u16string_view s) { - std::u16string result; - for (auto c : s) result.push_back(ToUpper(c)); - return result; -} } // namespace cru -- cgit v1.2.3