MCPcopy Create free account
hub / github.com/danoon2/Boxedwine / PassFilter

Method PassFilter

lib/imgui/imgui.cpp:2023–2055  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2021}
2022
2023bool ImGuiTextFilter::PassFilter(const char* text, const char* text_end) const
2024{
2025 if (Filters.empty())
2026 return true;
2027
2028 if (text == NULL)
2029 text = "";
2030
2031 for (int i = 0; i != Filters.Size; i++)
2032 {
2033 const ImGuiTextRange& f = Filters[i];
2034 if (f.empty())
2035 continue;
2036 if (f.b[0] == '-')
2037 {
2038 // Subtract
2039 if (ImStristr(text, text_end, f.b + 1, f.e) != NULL)
2040 return false;
2041 }
2042 else
2043 {
2044 // Grep
2045 if (ImStristr(text, text_end, f.b, f.e) != NULL)
2046 return true;
2047 }
2048 }
2049
2050 // Implicit * grep
2051 if (CountGrep == 0)
2052 return true;
2053
2054 return false;
2055}
2056
2057//-----------------------------------------------------------------------------
2058// [SECTION] ImGuiTextBuffer

Callers 3

ShowDemoWindowMiscFunction · 0.80
ShowStyleEditorMethod · 0.80
DrawFunction · 0.80

Calls 2

ImStristrFunction · 0.85
emptyMethod · 0.45

Tested by

no test coverage detected