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

Function trimUTF32Vector

core/base/UTF8.cpp:232–254  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

230}
231
232void 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
256template <typename T>
257struct ConvertTrait

Callers

nothing calls this directly

Calls 3

isUnicodeSpaceFunction · 0.85
trimUTF32VectorFromIndexFunction · 0.85
sizeMethod · 0.45

Tested by

no test coverage detected