| 229 | } |
| 230 | |
| 231 | int NextTextElementPos(const char* text, int pos, int langID) |
| 232 | { |
| 233 | if (!text) |
| 234 | return pos; |
| 235 | |
| 236 | int len = static_cast<int>(strlen(text)); |
| 237 | if (pos < 0) |
| 238 | pos = 0; |
| 239 | if (pos >= len) |
| 240 | return len; |
| 241 | |
| 242 | int step = Utf8CodepointBytes(text + pos); |
| 243 | step = std::min(step, len - pos); |
| 244 | return pos + step; |
| 245 | } |
| 246 | |
| 247 | int PrevTextElementPos(const char* text, int pos, int langID) |
| 248 | { |
no test coverage detected