| 3103 | } |
| 3104 | |
| 3105 | bool ImGuiTextFilter::PassFilter(const char* text, const char* text_end) const |
| 3106 | { |
| 3107 | if (Filters.Size == 0) |
| 3108 | return true; |
| 3109 | |
| 3110 | if (text == NULL) |
| 3111 | text = text_end = ""; |
| 3112 | |
| 3113 | for (const ImGuiTextRange& f : Filters) |
| 3114 | { |
| 3115 | if (f.b == f.e) |
| 3116 | continue; |
| 3117 | if (f.b[0] == '-') |
| 3118 | { |
| 3119 | // Subtract |
| 3120 | if (ImStristr(text, text_end, f.b + 1, f.e) != NULL) |
| 3121 | return false; |
| 3122 | } |
| 3123 | else |
| 3124 | { |
| 3125 | // Grep |
| 3126 | if (ImStristr(text, text_end, f.b, f.e) != NULL) |
| 3127 | return true; |
| 3128 | } |
| 3129 | } |
| 3130 | |
| 3131 | // Implicit * grep |
| 3132 | if (CountGrep == 0) |
| 3133 | return true; |
| 3134 | |
| 3135 | return false; |
| 3136 | } |
| 3137 | |
| 3138 | //----------------------------------------------------------------------------- |
| 3139 | // [SECTION] ImGuiTextBuffer, ImGuiTextIndex |
no test coverage detected