OpenTTD Source
20240917-master-g9ab0a47812
|
Go to the documentation of this file.
10 #ifndef STRINGFILTER_TYPE_H
11 #define STRINGFILTER_TYPE_H
60 bool IsEmpty()
const {
return this->word_index.empty(); }
64 void AddLine(
const std::string &str);
71 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.
uint32_t StringID
Numeric value that represents a string, independent of the selected language.
void AddLine(const char *str)
Pass another text line from the current item to the filter.
void free(const void *ptr)
Version of the standard free that accepts const pointers.
State of a single filter word.
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.
StringFilter(const bool *case_sensitive=nullptr, bool locale_aware=true)
Constructor for filter.
bool locale_aware
Match words using the current locale.
std::vector< WordState > word_index
Word index and filter state.