| 269 | } |
| 270 | |
| 271 | UTF16ToUTF32Index::UTF16ToUTF32Index(const char16_t* /*utf16String*/, |
| 272 | size_t utf16Length, |
| 273 | const uint32_t* utf32String, |
| 274 | size_t utf32Length) |
| 275 | : _offsets(utf16Length - utf32Length) { |
| 276 | size_t offsetPosition = 0; |
| 277 | // We store positions within the UTF32 string where the characters are represented as 2 UTF16 characters |
| 278 | for (size_t i = 0; i < utf32Length; i++) { |
| 279 | if (countUtf32ToUtf16(utf32String[i]) == 2) { |
| 280 | _offsets.data()[offsetPosition++] = i; |
| 281 | } |
| 282 | } |
| 283 | } |
| 284 | |
| 285 | size_t UTF16ToUTF32Index::getUTF32Index(size_t utf16Index) const { |
| 286 | size_t utf32Index = utf16Index; |
nothing calls this directly
no test coverage detected