Class sh::search::criteria::AbstractStringSearchCriterion

class sh::search::criteria::AbstractStringSearchCriterion : public sh::search::SearchCriterion

Abstract search criterion filtering by some string value (providing different modes like exact, fuzzy, regexp, …).

Subclassed by sh::search::criteria::FileContentSearchCriterion, sh::search::criteria::FilenameSearchCriterion

Public Types

enum Mode

Values:

enumerator Simple
enumerator Exact
enumerator RegExp
enumerator Fuzzy

Public Functions

AbstractStringSearchCriterion(std::shared_ptr<sh::search::SearchCriterionFactory> factory)
bool match(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl)

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

QString valuedescription()

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

QString serialize()

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

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

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

Public Members

QString string
Mode mode = Mode::Simple

Public Static Functions

void _createEditor(std::shared_ptr<sh::search::SearchCriterion> cfg, ui::SearchPanelConfiguration *panelcfg)
void _editorUpdateConfiguration(sh::ui::SearchPanelConfiguration *panelcfg, std::shared_ptr<sh::search::SearchCriterion> c)
int levenshteinSubstringDistance(QString needle, QString haystack)
double relativeLevenshteinPartsSubstringDistance(QString needle, QString haystack)
std::shared_ptr<sh::search::SearchCriterion> deserialize(QString s)

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

Public Static Attributes

const QStringList ModeCodes