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

Function ImTextCountLines

imgui_tiny_app/imgui/imgui.cpp:2841–2853  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2839}
2840
2841int ImTextCountLines(const char* in_text, const char* in_text_end)
2842{
2843 if (in_text_end == NULL)
2844 in_text_end = in_text + ImStrlen(in_text); // FIXME-OPT: Not optimal approach, discourage use for now.
2845 int count = 0;
2846 while (in_text < in_text_end)
2847 {
2848 const char* line_end = (const char*)ImMemchr(in_text, '\n', in_text_end - in_text);
2849 in_text = line_end ? line_end + 1 : in_text_end;
2850 count++;
2851 }
2852 return count;
2853}
2854
2855IM_MSVC_RUNTIME_CHECKS_RESTORE
2856

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected