PrismLauncher/launcher/Filter.h

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

43 lines
814 B
C
Raw Normal View History

2018-03-19 01:36:12 +00:00
#pragma once
#include <QString>
#include <QRegularExpression>
class Filter
2018-03-19 01:36:12 +00:00
{
public:
virtual ~Filter();
virtual bool accepts(const QString & value) = 0;
};
class ContainsFilter: public Filter
2018-03-19 01:36:12 +00:00
{
public:
ContainsFilter(const QString &pattern);
virtual ~ContainsFilter();
bool accepts(const QString & value) override;
private:
QString pattern;
};
class ExactFilter: public Filter
2018-03-19 01:36:12 +00:00
{
public:
ExactFilter(const QString &pattern);
virtual ~ExactFilter();
bool accepts(const QString & value) override;
private:
QString pattern;
};
class RegexpFilter: public Filter
2018-03-19 01:36:12 +00:00
{
public:
RegexpFilter(const QString &regexp, bool invert);
virtual ~RegexpFilter();
bool accepts(const QString & value) override;
private:
QRegularExpression pattern;
bool invert = false;
};