MCPcopy Create free account
hub / github.com/DISTRHO/Cardinal / ImTextStrFromUtf8

Function ImTextStrFromUtf8

plugins/Cardinal/src/DearImGui/imgui.cpp:1714–1730  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1712}
1713
1714int ImTextStrFromUtf8(ImWchar* buf, int buf_size, const char* in_text, const char* in_text_end, const char** in_text_remaining)
1715{
1716 ImWchar* buf_out = buf;
1717 ImWchar* buf_end = buf + buf_size;
1718 while (buf_out < buf_end - 1 && (!in_text_end || in_text < in_text_end) && *in_text)
1719 {
1720 unsigned int c;
1721 in_text += ImTextCharFromUtf8(&c, in_text, in_text_end);
1722 if (c == 0)
1723 break;
1724 *buf_out++ = (ImWchar)c;
1725 }
1726 *buf_out = 0;
1727 if (in_text_remaining)
1728 *in_text_remaining = in_text;
1729 return (int)(buf_out - buf);
1730}
1731
1732int ImTextCountCharsFromUtf8(const char* in_text, const char* in_text_end)
1733{

Callers 1

InputTextExMethod · 0.85

Calls 1

ImTextCharFromUtf8Function · 0.85

Tested by

no test coverage detected