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

Function PrevTextElementPos

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

Source from the content-addressed store, hash-verified

245}
246
247int PrevTextElementPos(const char* text, int pos, int langID)
248{
249 if (!text)
250 return pos;
251 if (pos <= 0)
252 return 0;
253
254 int i = pos - 1;
255 while (i > 0 && IsUtf8ContinuationByte(static_cast<unsigned char>(text[i])))
256 --i;
257 return i;
258}
259
260int CountTextElements(const char* text, int langID)
261{

Callers 2

PrevPosMethod · 0.85

Calls 1

IsUtf8ContinuationByteFunction · 0.85

Tested by

no test coverage detected