MCPcopy Create free account
hub / github.com/BohemiaInteractive/CWR / NextTextElementPos

Function NextTextElementPos

engine/Poseidon/Foundation/Strings/Mbcs.cpp:231–245  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

229}
230
231int 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
247int PrevTextElementPos(const char* text, int pos, int langID)
248{

Callers 4

NextPosMethod · 0.85
CountTextElementsFunction · 0.85
CopyTextElementFunction · 0.85

Calls 2

Utf8CodepointBytesFunction · 0.85
minFunction · 0.85

Tested by

no test coverage detected