MCPcopy Create free account
hub / github.com/KebsCS/KBotExt / PassFilter

Method PassFilter

KBotExt/imgui/imgui.cpp:2558–2589  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2556}
2557
2558bool ImGuiTextFilter::PassFilter(const char* text, const char* text_end) const
2559{
2560 if (Filters.empty())
2561 return true;
2562
2563 if (text == NULL)
2564 text = "";
2565
2566 for (const ImGuiTextRange& f : Filters)
2567 {
2568 if (f.empty())
2569 continue;
2570 if (f.b[0] == '-')
2571 {
2572 // Subtract
2573 if (ImStristr(text, text_end, f.b + 1, f.e) != NULL)
2574 return false;
2575 }
2576 else
2577 {
2578 // Grep
2579 if (ImStristr(text, text_end, f.b, f.e) != NULL)
2580 return true;
2581 }
2582 }
2583
2584 // Implicit * grep
2585 if (CountGrep == 0)
2586 return true;
2587
2588 return false;
2589}
2590
2591//-----------------------------------------------------------------------------
2592// [SECTION] ImGuiTextBuffer, ImGuiTextIndex

Callers

nothing calls this directly

Calls 2

ImStristrFunction · 0.85
emptyMethod · 0.45

Tested by

no test coverage detected