12 #ifndef STRINGFILTER_TYPE_H 13 #define STRINGFILTER_TYPE_H 52 StringFilter(
const bool *case_sensitive = NULL) : filter_buffer(NULL), word_matches(0), case_sensitive(case_sensitive) {}
71 bool GetState()
const {
return this->word_matches == this->word_index.
Length(); }
bool match
Already matched?
Simple vector class that allows allocating an item without the need to copy this->data needlessly...
void ResetState()
Reset the matching state to process a new item.
bool GetState() const
Get the matching state of the current item.
Simple vector template class.
const char * filter_buffer
Parsed filter string. Words separated by 0.
void SetFilterTerm(const char *str)
Set the term to filter on.
uint Length() const
Get the number of items in the list.
const char * start
Word to filter for.
uint word_matches
Summary of filter state: Number of words matched.
StringFilter(const bool *case_sensitive=NULL)
Constructor for filter.
State of a single filter word.
uint32 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.
const bool * case_sensitive
Match case-sensitively (usually a static variable).
Types related to strings.
static void free(const void *ptr)
Version of the standard free that accepts const pointers.
SmallVector< WordState, 4 > word_index
Word index and filter state.
bool IsEmpty() const
Check whether any filter words were entered.