| 2113 | } |
| 2114 | |
| 2115 | void ImGuiTextFilter::Build() |
| 2116 | { |
| 2117 | Filters.resize(0); |
| 2118 | ImGuiTextRange input_range(InputBuf, InputBuf + strlen(InputBuf)); |
| 2119 | input_range.split(',', &Filters); |
| 2120 | |
| 2121 | CountGrep = 0; |
| 2122 | for (int i = 0; i != Filters.Size; i++) |
| 2123 | { |
| 2124 | ImGuiTextRange& f = Filters[i]; |
| 2125 | while (f.b < f.e && ImCharIsBlankA(f.b[0])) |
| 2126 | f.b++; |
| 2127 | while (f.e > f.b && ImCharIsBlankA(f.e[-1])) |
| 2128 | f.e--; |
| 2129 | if (f.empty()) |
| 2130 | continue; |
| 2131 | if (Filters[i].b[0] != '-') |
| 2132 | CountGrep += 1; |
| 2133 | } |
| 2134 | } |
| 2135 | |
| 2136 | bool ImGuiTextFilter::PassFilter(const char* text, const char* text_end) const |
| 2137 | { |
no test coverage detected