21#ifndef G_STRING_LIST_H
22#define G_STRING_LIST_H
42 Ignore = Ignore::Nothing ) ;
48 Ignore = Ignore::Nothing ) ;
55 Ignore = Ignore::Nothing ) ;
96 Filter & deny(
const std::string & d )
static void splitIntoTokens(const std::string &in, StringArray &out, std::string_view ws, char esc='\0')
Splits the string into 'ws'-delimited tokens.
A class template like a simplified c++17 std::optional.
bool has_value() const noexcept
Returns true if a defined value.
T value_or(const T &) const
Returns the value or a default.
void applyMatch(StringArray &list, const StringArray &allow_list, Ignore=Ignore::Nothing)
Removes items in the list that do not match any entry in the allow list and reorders the result to be...
void keepMatch(StringArray &list, const StringArray &allow_list, Ignore=Ignore::Nothing)
Removes items in the list that do not match any entry in the allow list.
bool match(const StringArray &, const std::string &)
Returns true if any string in the array matches the given string.
bool tailMatch(const StringArray &list, std::string_view ending)
Returns true if any string in the array has the given ending (or the given ending is empty).
bool headMatch(const StringArray &list, std::string_view head)
Returns true if any string in the array has the given start (or 'head' is empty).
bool imatch(const StringArray &, const std::string &)
Returns true if any string in the array matches the given string, ignoring case.
void removeMatch(StringArray &list, const StringArray &deny_list, Ignore=Ignore::Nothing)
Removes items in the list that match an entry in the deny list.
std::string headMatchResidue(const StringArray &list, std::string_view head)
Returns the unmatched part of the first string in the array that has the given start.
std::vector< std::string > StringArray
A std::vector of std::strings.
Filters a list of strings with allow and deny lists.