aboutsummaryrefslogtreecommitdiff
path: root/include/cru/win
diff options
context:
space:
mode:
authorcrupest <crupest@outlook.com>2019-12-31 23:24:01 +0800
committercrupest <crupest@outlook.com>2019-12-31 23:24:01 +0800
commit13d84d93e6695184a92cc0b7f85230e7b78d7a96 (patch)
treee60323b65ada0edac2e309235c16e4ae241b92ab /include/cru/win
parented6bab6393d768bd46f0072113edc80b9f33ac75 (diff)
downloadcru-13d84d93e6695184a92cc0b7f85230e7b78d7a96.tar.gz
cru-13d84d93e6695184a92cc0b7f85230e7b78d7a96.tar.bz2
cru-13d84d93e6695184a92cc0b7f85230e7b78d7a96.zip
...
Diffstat (limited to 'include/cru/win')
-rw-r--r--include/cru/win/string.hpp14
1 files changed, 11 insertions, 3 deletions
diff --git a/include/cru/win/string.hpp b/include/cru/win/string.hpp
index 75395052..3fdadbf8 100644
--- a/include/cru/win/string.hpp
+++ b/include/cru/win/string.hpp
@@ -60,9 +60,10 @@ class Utf8Iterator : public Object {
};
class Utf16Iterator : public Object {
- static_assert(sizeof(wchar_t) == 2,
- "Emmm, according to my knowledge, wchar_t should be 2-length on "
- "Windows. If not, Utf16 will be broken.");
+ static_assert(
+ sizeof(wchar_t) == 2,
+ "Emmm, according to my knowledge, wchar_t should be 2-length on "
+ "Windows. If not, Utf16 will be broken.");
public:
Utf16Iterator(const std::wstring_view& string) : string_(string) {}
@@ -86,4 +87,11 @@ class Utf16Iterator : public Object {
std::wstring_view string_;
int position_ = 0;
};
+
+int IndexUtf8ToUtf16(const std::string_view& utf8_string, int utf8_index,
+ const std::wstring_view& utf16_string);
+
+int IndexUtf16ToUtf8(const std::wstring_view& utf16_string, int utf16_index,
+ const std::string_view& utf8_string);
+
} // namespace cru::platform::win