2019-08-17 11:06:35 +02:00
|
|
|
#ifndef TOKEN_H
|
|
|
|
#define TOKEN_H
|
|
|
|
#include <QString>
|
|
|
|
|
|
|
|
enum TokenType
|
|
|
|
{
|
2022-06-04 23:12:58 +02:00
|
|
|
WORD = 8,
|
|
|
|
NEGATION = 16,
|
|
|
|
BOOL = 32,
|
2019-08-17 11:06:35 +02:00
|
|
|
BOOL_AND,
|
|
|
|
BOOL_OR,
|
2022-06-04 23:12:58 +02:00
|
|
|
GROUP = 64,
|
2019-08-17 11:06:35 +02:00
|
|
|
BRACKET_OPEN,
|
|
|
|
BRACKET_CLOSE,
|
2022-06-04 23:12:58 +02:00
|
|
|
SORT = 128,
|
|
|
|
FILTER_PATH = 256,
|
2019-08-17 11:06:35 +02:00
|
|
|
FILTER_PATH_MTIME,
|
|
|
|
FILTER_PATH_CONTAINS,
|
|
|
|
FILTER_PATH_SIZE,
|
|
|
|
FILTER_PATH_ENDS,
|
|
|
|
FILTER_PATH_STARTS,
|
2022-06-04 23:12:58 +02:00
|
|
|
FILTER_CONTENT = 512,
|
2019-08-17 11:06:35 +02:00
|
|
|
FILTER_CONTENT_CONTAINS,
|
|
|
|
FILTER_CONTENT_PAGE,
|
2022-06-04 23:12:58 +02:00
|
|
|
LIMIT = 1024
|
2019-08-17 11:06:35 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
class Token
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
Token()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
Token(TokenType type)
|
|
|
|
{
|
|
|
|
this->type = type;
|
|
|
|
}
|
|
|
|
|
|
|
|
Token(TokenType type, QString value)
|
|
|
|
{
|
|
|
|
this->type = type;
|
|
|
|
this->value = value;
|
|
|
|
}
|
|
|
|
|
|
|
|
TokenType type;
|
|
|
|
QString value;
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif // TOKEN_H
|