MCPcopy Create free account
hub / github.com/InteractiveComputerGraphics/SPlisHSPlasH / PassFilter

Method PassFilter

extern/imgui/imgui.cpp:2497–2529  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2495}
2496
2497bool ImGuiTextFilter::PassFilter(const char* text, const char* text_end) const
2498{
2499 if (Filters.empty())
2500 return true;
2501
2502 if (text == NULL)
2503 text = "";
2504
2505 for (int i = 0; i != Filters.Size; i++)
2506 {
2507 const ImGuiTextRange& f = Filters[i];
2508 if (f.empty())
2509 continue;
2510 if (f.b[0] == '-')
2511 {
2512 // Subtract
2513 if (ImStristr(text, text_end, f.b + 1, f.e) != NULL)
2514 return false;
2515 }
2516 else
2517 {
2518 // Grep
2519 if (ImStristr(text, text_end, f.b, f.e) != NULL)
2520 return true;
2521 }
2522 }
2523
2524 // Implicit * grep
2525 if (CountGrep == 0)
2526 return true;
2527
2528 return false;
2529}
2530
2531//-----------------------------------------------------------------------------
2532// [SECTION] ImGuiTextBuffer, ImGuiTextIndex

Callers 3

ShowDemoWindowWidgetsFunction · 0.80
ShowStyleEditorMethod · 0.80
DrawFunction · 0.80

Calls 2

ImStristrFunction · 0.85
emptyMethod · 0.45

Tested by

no test coverage detected