This class makes it easy to associate tags and tag values with
Taggeditems, filtering matching Tagged items from a set of candidates.
- tags are the actual tags attached to a
Tagged item.
- filters are the names and values used to filter the tag sets.
Tag names and filter names must be simple words. Filter values can have regex expressions, however.
When a filter value starts and ends with a single quote, the quotes are removed as a convencience
for deal with shell escapes, etc. This means that value
'five-oh.*five'
is the same as
five-oh.*five, except that the former will not cause undesirable
shell expansion on command lines.
When a Tagged item is filtered, the following checks are made for each
tag specified in the filter:
- The Tagged item must have a tag with the same name as a filter.
- If the filter has a value in addition to the tag name, then the Tagged item
must also have a value for that tag name. Furthermore, the value has to match.
- If the filter value, converted to a Regex, matches the tag value,
it is deemed to be a match.
Because advanced tag usage can sometimes be unintuitive, the tag filtering logic has
a built-in log which can explain why a candidate item did or did not match a particular
set of filters.