virtual */
| 428 | } |
| 429 | |
| 430 | /* virtual */ size_t OSXStringIterator::SetCurPosition(size_t pos) |
| 431 | { |
| 432 | /* Convert incoming position to an UTF-16 string index. */ |
| 433 | size_t utf16_pos = 0; |
| 434 | for (size_t i = 0; i < this->utf16_to_utf8.size(); i++) { |
| 435 | if (this->utf16_to_utf8[i] == pos) { |
| 436 | utf16_pos = i; |
| 437 | break; |
| 438 | } |
| 439 | } |
| 440 | |
| 441 | /* Sanitize in case we get a position inside a grapheme cluster. */ |
| 442 | while (utf16_pos > 0 && !this->str_info[utf16_pos].char_stop) utf16_pos--; |
| 443 | this->cur_pos = utf16_pos; |
| 444 | |
| 445 | return this->utf16_to_utf8[this->cur_pos]; |
| 446 | } |
| 447 | |
| 448 | /* virtual */ size_t OSXStringIterator::Next(IterType what) |
| 449 | { |
no test coverage detected