OpenTTD Source
1.11.0-beta2
|
Go to the documentation of this file.
10 #ifndef STRINGFILTER_TYPE_H
11 #define STRINGFILTER_TYPE_H
59 bool IsEmpty()
const {
return this->word_index.size() == 0; }
69 bool GetState()
const {
return this->word_matches == this->word_index.size(); }
bool IsEmpty() const
Check whether any filter words were entered.
void SetFilterTerm(const char *str)
Set the term to filter on.
StringFilter(const bool *case_sensitive=nullptr)
Constructor for filter.
void AddLine(const char *str)
Pass another text line from the current item to the filter.
State of a single filter word.
uint32 StringID
Numeric value that represents a string, independent of the selected language.
const bool * case_sensitive
Match case-sensitively (usually a static variable).
uint word_matches
Summary of filter state: Number of words matched.
bool match
Already matched?
void ResetState()
Reset the matching state to process a new item.
const char * start
Word to filter for.
bool GetState() const
Get the matching state of the current item.
const char * filter_buffer
Parsed filter string. Words separated by 0.
std::vector< WordState > word_index
Word index and filter state.
static void free(const void *ptr)
Version of the standard free that accepts const pointers.