20 #ifndef MPD_SONG_FILTER_HXX 21 #define MPD_SONG_FILTER_HXX 35 #define LOCATE_TAG_BASE_TYPE (TAG_NUM_OF_ITEM_TYPES + 1) 36 #define LOCATE_TAG_MODIFIED_SINCE (TAG_NUM_OF_ITEM_TYPES + 2) 38 #define LOCATE_TAG_FILE_TYPE TAG_NUM_OF_ITEM_TYPES+10 39 #define LOCATE_TAG_ANY_TYPE TAG_NUM_OF_ITEM_TYPES+20 66 Item(
unsigned tag, const
char *value,
bool fold_case=false);
67 Item(
unsigned tag, time_t time);
82 bool StringMatch(const
char *s) const noexcept;
88 bool Match(const
Tag &tag) const noexcept;
98 std::list<
Item> items;
104 SongFilter(
unsigned tag, const
char *value,
bool fold_case=false);
109 bool Parse(const
char *tag, const
char *value,
bool fold_case=false);
114 bool Match(const
Tag &tag) const noexcept;
128 return items.empty();
136 for (
const auto &i : items)
154 const
char *
GetBase() const noexcept;
The meta information about a song file.
bool Parse(ConstBuffer< const char *> args, bool fold_case=false)
const std::list< Item > & GetItems() const noexcept
gcc_nonnull(3) Item(unsigned tag
This class can compare one string ("needle") with lots of other strings ("haystacks") efficiently...
gcc_pure unsigned locate_parse_type(const char *str) noexcept
gcc_pure bool HasFoldCase() const noexcept
Is there at least one item with "fold case" enabled?
const char * GetValue() const
gcc_pure const char * GetBase() const noexcept
Returns the "base" specification (if there is one) or nullptr.
A reference to a memory area that is read-only.
gcc_pure bool IsEmpty() const noexcept
gcc_pure bool HasOtherThanBase() const noexcept
Does this filter contain constraints other than "base"?
gcc_pure bool Match(const TagItem &tag_item) const noexcept
SongFilter WithoutBasePrefix(const char *prefix) const noexcept
Create a copy of the filter with the given prefix stripped from all LOCATE_TAG_BASE_TYPE items...
A reference to a song file.