Filter elements with given expressions.
More...
#include <Workspace/Application/filter.h>
|
typedef std::function< QVariant(int index)> | Accessor |
|
|
| Filter () |
|
void | defineDateCompare (QString key, int index, QStringList ops={"=", "<", ">"}) |
|
void | defineStringCompare (QString key, int index, QStringList ops={"=", "!=", "<>", "~", "!~"}) |
|
Context | parse (const QString &filterString) const |
| split filter string into standalone expressions each contains a form of key op value where the key is a single word, op is one of ops defined.
|
|
QString | removeExpression (const QString &filterString, const QString &key) |
|
QString | replaceExpression (const QString &filterString, const QString &expression) |
|
QStringList | splitExpression (const QString &filterString) const |
|
Stage 1: define compare of interest with define*Compare() methods Stage 2: use splitExpression() to construct a Context based on the filter expressions Stage 3: use the Context to filter elements
◆ Accessor
typedef std::function<QVariant(int index)> Accessor |
◆ Filter()
◆ defineDateCompare()
void defineDateCompare |
( |
QString |
key, |
|
|
int |
index, |
|
|
QStringList |
ops = {"=", "<", ">"} |
|
) |
| |
|
inline |
◆ defineStringCompare()
void defineStringCompare |
( |
QString |
key, |
|
|
int |
index, |
|
|
QStringList |
ops = {"=", "!=", "<>", "~", "!~"} |
|
) |
| |
|
inline |
◆ parse()
◆ removeExpression()
QString removeExpression |
( |
const QString & |
filterString, |
|
|
const QString & |
key |
|
) |
| |
◆ replaceExpression()
QString replaceExpression |
( |
const QString & |
filterString, |
|
|
const QString & |
expression |
|
) |
| |
◆ splitExpression()
QStringList splitExpression |
( |
const QString & |
filterString | ) |
const |