| 2021 | } |
| 2022 | |
| 2023 | bool 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 |
no test coverage detected