| 206 | } |
| 207 | |
| 208 | void trimUTF16Vector(std::vector<char16_t>& str) |
| 209 | { |
| 210 | int len = static_cast<int>(str.size()); |
| 211 | |
| 212 | if (len <= 0) |
| 213 | return; |
| 214 | |
| 215 | int last_index = len - 1; |
| 216 | |
| 217 | // Only start trimming if the last character is whitespace.. |
| 218 | if (isUnicodeSpace(str[last_index])) |
| 219 | { |
| 220 | for (int i = last_index - 1; i >= 0; --i) |
| 221 | { |
| 222 | if (isUnicodeSpace(str[i])) |
| 223 | last_index = i; |
| 224 | else |
| 225 | break; |
| 226 | } |
| 227 | |
| 228 | trimUTF16VectorFromIndex(str, last_index); |
| 229 | } |
| 230 | } |
| 231 | |
| 232 | void trimUTF32Vector(std::vector<char32_t>& str) |
| 233 | { |
no test coverage detected