| 2299 | } |
| 2300 | |
| 2301 | void ImGuiTextFilter::Build() |
| 2302 | { |
| 2303 | Filters.resize(0); |
| 2304 | ImGuiTextRange input_range(InputBuf, InputBuf + strlen(InputBuf)); |
| 2305 | input_range.split(',', &Filters); |
| 2306 | |
| 2307 | CountGrep = 0; |
| 2308 | for (int i = 0; i != Filters.Size; i++) |
| 2309 | { |
| 2310 | ImGuiTextRange& f = Filters[i]; |
| 2311 | while (f.b < f.e && ImCharIsBlankA(f.b[0])) |
| 2312 | f.b++; |
| 2313 | while (f.e > f.b && ImCharIsBlankA(f.e[-1])) |
| 2314 | f.e--; |
| 2315 | if (f.empty()) |
| 2316 | continue; |
| 2317 | if (Filters[i].b[0] != '-') |
| 2318 | CountGrep += 1; |
| 2319 | } |
| 2320 | } |
| 2321 | |
| 2322 | bool ImGuiTextFilter::PassFilter(const char* text, const char* text_end) const |
| 2323 | { |
no test coverage detected