MCPcopy Create free account
hub / github.com/Wemino/EchoPatch / ImTextStrFromUtf8

Function ImTextStrFromUtf8

include/imgui/imgui.cpp:2634–2648  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2632}
2633
2634int ImTextStrFromUtf8(ImWchar* buf, int buf_size, const char* in_text, const char* in_text_end, const char** in_text_remaining)
2635{
2636 ImWchar* buf_out = buf;
2637 ImWchar* buf_end = buf + buf_size;
2638 while (buf_out < buf_end - 1 && (!in_text_end || in_text < in_text_end) && *in_text)
2639 {
2640 unsigned int c;
2641 in_text += ImTextCharFromUtf8(&c, in_text, in_text_end);
2642 *buf_out++ = (ImWchar)c;
2643 }
2644 *buf_out = 0;
2645 if (in_text_remaining)
2646 *in_text_remaining = in_text;
2647 return (int)(buf_out - buf);
2648}
2649
2650int ImTextCountCharsFromUtf8(const char* in_text, const char* in_text_end)
2651{

Callers

nothing calls this directly

Calls 1

ImTextCharFromUtf8Function · 0.85

Tested by

no test coverage detected