From 13d84d93e6695184a92cc0b7f85230e7b78d7a96 Mon Sep 17 00:00:00 2001 From: crupest Date: Tue, 31 Dec 2019 23:24:01 +0800 Subject: ... --- include/cru/win/string.hpp | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'include') 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 -- cgit v1.2.3