MCPcopy Create free account
hub / github.com/Aegel5/SimpleSwitcher / ImTextCountUtf8BytesFromStr

Function ImTextCountUtf8BytesFromStr

imgui_tiny_app/imgui/imgui.cpp:2804–2816  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2802}
2803
2804int ImTextCountUtf8BytesFromStr(const ImWchar* in_text, const ImWchar* in_text_end)
2805{
2806 int bytes_count = 0;
2807 while ((!in_text_end || in_text < in_text_end) && *in_text)
2808 {
2809 unsigned int c = (unsigned int)(*in_text++);
2810 if (c < 0x80)
2811 bytes_count++;
2812 else
2813 bytes_count += ImTextCountUtf8BytesFromChar(c);
2814 }
2815 return bytes_count;
2816}
2817
2818const char* ImTextFindPreviousUtf8Codepoint(const char* in_text_start, const char* in_p)
2819{

Callers 1

Calls 1

Tested by

no test coverage detected