| 230 | } |
| 231 | |
| 232 | void trimUTF32Vector(std::vector<char32_t>& str) |
| 233 | { |
| 234 | int len = static_cast<int>(str.size()); |
| 235 | |
| 236 | if (len <= 0) |
| 237 | return; |
| 238 | |
| 239 | int last_index = len - 1; |
| 240 | |
| 241 | // Only start trimming if the last character is whitespace.. |
| 242 | if (isUnicodeSpace(str[last_index])) |
| 243 | { |
| 244 | for (int i = last_index - 1; i >= 0; --i) |
| 245 | { |
| 246 | if (isUnicodeSpace(str[i])) |
| 247 | last_index = i; |
| 248 | else |
| 249 | break; |
| 250 | } |
| 251 | |
| 252 | trimUTF32VectorFromIndex(str, last_index); |
| 253 | } |
| 254 | } |
| 255 | |
| 256 | template <typename T> |
| 257 | struct ConvertTrait |
nothing calls this directly
no test coverage detected