MCPcopy Create free account
hub / github.com/axmolengine/axmol / trimUTF16Vector

Function trimUTF16Vector

core/base/UTF8.cpp:208–230  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

206}
207
208void 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
232void trimUTF32Vector(std::vector<char32_t>& str)
233{

Callers 1

UTF8Tests.cppFile · 0.85

Calls 3

isUnicodeSpaceFunction · 0.85
trimUTF16VectorFromIndexFunction · 0.85
sizeMethod · 0.45

Tested by

no test coverage detected