| 2932 | } |
| 2933 | |
| 2934 | bool ImGuiTextFilter::PassFilter(const char* text, const char* text_end) const |
| 2935 | { |
| 2936 | if (Filters.Size == 0) |
| 2937 | return true; |
| 2938 | |
| 2939 | if (text == NULL) |
| 2940 | text = text_end = ""; |
| 2941 | |
| 2942 | for (const ImGuiTextRange& f : Filters) |
| 2943 | { |
| 2944 | if (f.b == f.e) |
| 2945 | continue; |
| 2946 | if (f.b[0] == '-') |
| 2947 | { |
| 2948 | // Subtract |
| 2949 | if (ImStristr(text, text_end, f.b + 1, f.e) != NULL) |
| 2950 | return false; |
| 2951 | } |
| 2952 | else |
| 2953 | { |
| 2954 | // Grep |
| 2955 | if (ImStristr(text, text_end, f.b, f.e) != NULL) |
| 2956 | return true; |
| 2957 | } |
| 2958 | } |
| 2959 | |
| 2960 | // Implicit * grep |
| 2961 | if (CountGrep == 0) |
| 2962 | return true; |
| 2963 | |
| 2964 | return false; |
| 2965 | } |
| 2966 | |
| 2967 | //----------------------------------------------------------------------------- |
| 2968 | // [SECTION] ImGuiTextBuffer, ImGuiTextIndex |
no test coverage detected