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