diff options
author | crupest <crupest@outlook.com> | 2021-11-14 22:44:59 +0800 |
---|---|---|
committer | crupest <crupest@outlook.com> | 2021-11-14 22:44:59 +0800 |
commit | 63b4956c3a802ee1c0fd92d1ce56e9330b6de4d2 (patch) | |
tree | f13f592d810b797c4c64803719acbd258565ebce /src/common/String.cpp | |
parent | a744ed1fea0eaf4d946909da7fdc0a4c0f9c5ec0 (diff) | |
download | cru-63b4956c3a802ee1c0fd92d1ce56e9330b6de4d2.tar.gz cru-63b4956c3a802ee1c0fd92d1ce56e9330b6de4d2.tar.bz2 cru-63b4956c3a802ee1c0fd92d1ce56e9330b6de4d2.zip |
...
Diffstat (limited to 'src/common/String.cpp')
-rw-r--r-- | src/common/String.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
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 |