| 2495 | } |
| 2496 | |
| 2497 | bool ImGuiTextFilter::PassFilter(const char* text, const char* text_end) const |
| 2498 | { |
| 2499 | if (Filters.empty()) |
| 2500 | return true; |
| 2501 | |
| 2502 | if (text == NULL) |
| 2503 | text = ""; |
| 2504 | |
| 2505 | for (int i = 0; i != Filters.Size; i++) |
| 2506 | { |
| 2507 | const ImGuiTextRange& f = Filters[i]; |
| 2508 | if (f.empty()) |
| 2509 | continue; |
| 2510 | if (f.b[0] == '-') |
| 2511 | { |
| 2512 | // Subtract |
| 2513 | if (ImStristr(text, text_end, f.b + 1, f.e) != NULL) |
| 2514 | return false; |
| 2515 | } |
| 2516 | else |
| 2517 | { |
| 2518 | // Grep |
| 2519 | if (ImStristr(text, text_end, f.b, f.e) != NULL) |
| 2520 | return true; |
| 2521 | } |
| 2522 | } |
| 2523 | |
| 2524 | // Implicit * grep |
| 2525 | if (CountGrep == 0) |
| 2526 | return true; |
| 2527 | |
| 2528 | return false; |
| 2529 | } |
| 2530 | |
| 2531 | //----------------------------------------------------------------------------- |
| 2532 | // [SECTION] ImGuiTextBuffer, ImGuiTextIndex |
no test coverage detected