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

Function ImStristr

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

Source from the content-addressed store, hash-verified

1413}
1414
1415const char* ImStristr(const char* haystack, const char* haystack_end, const char* needle, const char* needle_end)
1416{
1417 if (!needle_end)
1418 needle_end = needle + strlen(needle);
1419
1420 const char un0 = (char)toupper(*needle);
1421 while ((!haystack_end && *haystack) || (haystack_end && haystack < haystack_end))
1422 {
1423 if (toupper(*haystack) == un0)
1424 {
1425 const char* b = needle + 1;
1426 for (const char* a = haystack + 1; b < needle_end; a++, b++)
1427 if (toupper(*a) != toupper(*b))
1428 break;
1429 if (b == needle_end)
1430 return haystack;
1431 }
1432 haystack++;
1433 }
1434 return NULL;
1435}
1436
1437// 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.
1438void ImStrTrimBlanks(char* buf)

Callers 1

PassFilterMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected