Class sh::search::SearchCriterion

class sh::search::SearchCriterion

Abstract base class for a search criterion.

Each search criterion implements how a user can filter his files in a search.

Register an implementation, e.g. with ‘REGISTER_CRITERION_FACTORY’ of “search/searchcriterionfactoryfromfunction.h”.

Subclassed by sh::search::criteria::AbstractActionDrivenSearchCriterion, sh::search::criteria::AbstractStringSearchCriterion, sh::search::criteria::ExtendedAttributeSearchCriterion, sh::search::criteria::MtimeSearchCriterion

Public Functions

SearchCriterion(std::shared_ptr<sh::search::SearchCriterionFactory> factory)
~SearchCriterion()
QString serialize()

Serializes this criterion to a string. See also SearchCriterion::deserialize.

bool match(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl) = 0

Checks if a given file (by eurl) matches this criterion. .

QString valuedescription() = 0

Returns a human readable text describing the current criterion shortly and precisely. .

std::shared_ptr<sh::search::SearchCriterionFactory> factory()

Returns the factory this criterion has created (provides some more metadata).

Public Static Functions

std::shared_ptr<sh::search::SearchCriterion> deserialize(QString s)

Deserializes this criterion from a string. See also SearchCriterion::serialize.