MCPcopy Create free account
hub / github.com/RenderKit/embree / ImTextCountUtf8BytesFromStr

Function ImTextCountUtf8BytesFromStr

tutorials/common/imgui/imgui.cpp:2123–2135  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2121}
2122
2123int ImTextCountUtf8BytesFromStr(const ImWchar* in_text, const ImWchar* in_text_end)
2124{
2125 int bytes_count = 0;
2126 while ((!in_text_end || in_text < in_text_end) && *in_text)
2127 {
2128 unsigned int c = (unsigned int)(*in_text++);
2129 if (c < 0x80)
2130 bytes_count++;
2131 else
2132 bytes_count += ImTextCountUtf8BytesFromChar(c);
2133 }
2134 return bytes_count;
2135}
2136
2137//-----------------------------------------------------------------------------
2138// [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