KNSCore::TagsFilterChecker

KNSCore::TagsFilterChecker Class Reference

#include <tagsfilterchecker.h>

Public Member Functions

 TagsFilterChecker (const QStringList &tagFilter)
 
 TagsFilterChecker (const TagsFilterChecker &)=delete
 
bool filterAccepts (const QStringList &tags)
 
TagsFilterCheckeroperator= (const TagsFilterChecker &)=delete
 

Detailed Description

Apply simple filtering logic to a list of tags.

== Examples of specifying tag filters == Value for tag "tagname" must be exactly "tagdata": tagname==tagdata

Value for tag "tagname" must be different from "tagdata": tagname!=tagdata

== Tag filter list == A tag filter list is a string list of filters as shown above, and a combination of which might look like:

  • ghns_excluded!=1
  • data##mimetype==application/cbr+zip
  • data##mimetype==application/cbr+rar

which would filter out anything which has ghns_excluded set to 1, and anything where the value of data##mimetype does not equal either "application/cbr+zip" or "application/cbr+rar". Notice in particular the two data##mimetype entries. Use this for when a tag may have multiple values.

The value does not current suppport wildcards. The list should be considered a binary AND operation (that is, all filter entries must match for the data entry to be included in the return data)

Since
5.51

Definition at line 55 of file tagsfilterchecker.h.

Constructor & Destructor Documentation

KNSCore::TagsFilterChecker::TagsFilterChecker ( const QStringList tagFilter)

Constructs an instance of the tags filter checker, prepopulated with the list of tag filters in the tagFilter parameter.

Parameters
tagFilterThe list of tag filters
Since
5.51

Definition at line 125 of file tagsfilterchecker.cpp.

Member Function Documentation

bool KNSCore::TagsFilterChecker::filterAccepts ( const QStringList tags)

Check whether the filter list accepts the passed list of tags.

Parameters
tagsA list of tags in the form of key=value strings
Returns
True if the filter accepts the list, false if not
Since
5.51

Definition at line 138 of file tagsfilterchecker.cpp.


The documentation for this class was generated from the following files:
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Fri Aug 7 2020 22:40:03 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.