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

Function ImStristr

tutorials/common/imgui/imgui.cpp:1694–1714  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1692}
1693
1694const char* ImStristr(const char* haystack, const char* haystack_end, const char* needle, const char* needle_end)
1695{
1696 if (!needle_end)
1697 needle_end = needle + strlen(needle);
1698
1699 const char un0 = (char)ImToUpper(*needle);
1700 while ((!haystack_end && *haystack) || (haystack_end && haystack < haystack_end))
1701 {
1702 if (ImToUpper(*haystack) == un0)
1703 {
1704 const char* b = needle + 1;
1705 for (const char* a = haystack + 1; b < needle_end; a++, b++)
1706 if (ImToUpper(*a) != ImToUpper(*b))
1707 break;
1708 if (b == needle_end)
1709 return haystack;
1710 }
1711 haystack++;
1712 }
1713 return NULL;
1714}
1715
1716// Trim str by offsetting contents when there's leading data + writing a \0 at the trailing position. We use this in situation where the cost is negligible.
1717void ImStrTrimBlanks(char* buf)

Callers 1

PassFilterMethod · 0.85

Calls 1

ImToUpperFunction · 0.85

Tested by

no test coverage detected