aboutsummaryrefslogtreecommitdiff
path: root/src/common/StringUtil.cpp
diff options
context:
space:
mode:
authorcrupest <crupest@outlook.com>2022-01-20 22:25:16 +0800
committercrupest <crupest@outlook.com>2022-01-20 22:25:16 +0800
commitb68d2027fe7505c14899db9fa1496b5ace09e25f (patch)
tree8361112fdf5a245794070ae8d58279c4b91cc54b /src/common/StringUtil.cpp
parent3c3a08a02a0f8fc56dc2da3374f025d4fdaf62c5 (diff)
downloadcru-b68d2027fe7505c14899db9fa1496b5ace09e25f.tar.gz
cru-b68d2027fe7505c14899db9fa1496b5ace09e25f.tar.bz2
cru-b68d2027fe7505c14899db9fa1496b5ace09e25f.zip
...
Diffstat (limited to 'src/common/StringUtil.cpp')
-rw-r--r--src/common/StringUtil.cpp28
1 files changed, 0 insertions, 28 deletions
diff --git a/src/common/StringUtil.cpp b/src/common/StringUtil.cpp
index 1f5f6150..2bec815d 100644
--- a/src/common/StringUtil.cpp
+++ b/src/common/StringUtil.cpp
@@ -149,34 +149,6 @@ CodePoint Utf16PreviousCodePoint(const char16_t* ptr, Index size, Index current,
return result;
}
-void Utf8EncodeCodePointAppend(CodePoint code_point, std::string& str) {
- if (!Utf8EncodeCodePointAppendWithFunc(code_point,
- [&str](char c) { str.push_back(c); }))
- throw TextEncodeException(u"Code point out of range.");
-}
-
-void Utf16EncodeCodePointAppend(CodePoint code_point, std::u16string& str) {
- if (!Utf16EncodeCodePointAppendWithFunc(
- code_point, [&str](char16_t c) { str.push_back(c); }))
- throw TextEncodeException(u"Code point out of range.");
-}
-
-std::string ToUtf8(const char16_t* ptr, Index size) {
- std::string result;
- for (CodePoint cp : Utf16CodePointIterator(ptr, size)) {
- Utf8EncodeCodePointAppend(cp, result);
- }
- return result;
-}
-
-std::u16string ToUtf16(const char* ptr, Index size) {
- std::u16string result;
- for (CodePoint cp : Utf8CodePointIterator(ptr, size)) {
- Utf16EncodeCodePointAppend(cp, result);
- }
- return result;
-}
-
bool Utf16IsValidInsertPosition(const char16_t* ptr, Index size,
Index position) {
if (position < 0) return false;