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

Function ImTextCountUtf8BytesFromStr

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

Source from the content-addressed store, hash-verified

1819}
1820
1821int ImTextCountUtf8BytesFromStr(const ImWchar* in_text, const ImWchar* in_text_end)
1822{
1823 int bytes_count = 0;
1824 while ((!in_text_end || in_text < in_text_end) && *in_text)
1825 {
1826 unsigned int c = (unsigned int)(*in_text++);
1827 if (c < 0x80)
1828 bytes_count++;
1829 else
1830 bytes_count += ImTextCountUtf8BytesFromChar(c);
1831 }
1832 return bytes_count;
1833}
1834
1835//-----------------------------------------------------------------------------
1836// [SECTION] MISC HELPERS/UTILITIES (Color functions)

Callers 3

STB_TEXTEDIT_DELETECHARSFunction · 0.85
STB_TEXTEDIT_INSERTCHARSFunction · 0.85
InputTextExMethod · 0.85

Calls 1

Tested by

no test coverage detected