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

Function CopyTextElement

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

Source from the content-addressed store, hash-verified

280}
281
282int CopyTextElement(const char* text, int pos, int langID, char* out, size_t outSize)
283{
284 if (!out || outSize == 0)
285 return pos;
286 out[0] = 0;
287
288 if (!text)
289 return pos;
290
291 int next = NextTextElementPos(text, pos, langID);
292 int span = std::max(0, next - pos);
293 size_t copyLen = std::min(static_cast<size_t>(span), outSize - 1);
294 if (copyLen > 0)
295 memcpy(out, text + pos, copyLen);
296 out[copyLen] = 0;
297 return next;
298}
299
300int EncodeUtf8Codepoint(uint32_t codepoint, char* out, size_t outSize)
301{

Callers 6

FormatTextMethod · 0.85
XToPosMethod · 0.85
FormatTextMethod · 0.85
XToPosMethod · 0.85
AUTO_STATIC_ARRAYFunction · 0.85

Calls 2

NextTextElementPosFunction · 0.85
minFunction · 0.85

Tested by

no test coverage detected