Herunterladen als
root/src/expression.h @ 7f1090e5
38838b5b | Christian Ehringfeld | /*
|
|
* Copyright (C) 2015 Christian Ehringfeld <c.ehringfeld@t-online.de>
|
|||
*
|
|||
* This program is free software; you can redistribute it and/or modify it
|
|||
* under the terms of the GNU Lesser General Public License as published by
|
|||
* the Free Software Foundation.
|
|||
*
|
|||
* This program is distributed in the hope that it will be useful, but
|
|||
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
|||
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
|||
* for more details.
|
|||
*
|
|||
* You should have received a copy of the GNU Lesser General Public License
|
|||
* along with this program; if not, see <http://www.gnu.org/licenses/>.
|
|||
*/
|
|||
3160499c | Christian Ehringfeld | #ifndef EXPRESSION_H
|
|
#define EXPRESSION_H
|
|||
#include <QHash>
|
|||
#include <QString>
|
|||
#include <QVariant>
|
|||
namespace CuteEntityManager {
|
|||
class Expression {
|
|||
public:
|
|||
Expression();
|
|||
67aa0d3f | Christian Ehringfeld | explicit Expression(QString expression,
|
|
QHash<QString, QVariant> params = QHash<QString, QVariant>(),
|
|||
bool onlyColumn = false);
|
|||
3b82c8c0 | Christian Ehringfeld | explicit Expression(QString expression,QString key,QVariant value,
|
|
bool onlyColumn = false);
|
|||
506067a2 | Christian Ehringfeld | explicit Expression(QString expression, bool onlyColumn);
|
|
3160499c | Christian Ehringfeld | QString getExpression() const;
|
|
void setExpression(const QString &value);
|
|||
QString toString() const;
|
|||
bool getOnlyColumn() const;
|
|||
void setOnlyColumn(bool value);
|
|||
3b82c8c0 | Christian Ehringfeld | QString generateParam();
|
|
ea6e88f6 | Christian Ehringfeld | void appendParam(QString key, const QVariant &value);
|
|
506067a2 | Christian Ehringfeld | QHash<QString, QVariant> getParams() const;
|
|
void setParams(const QHash<QString, QVariant> &value);
|
|||
67aa0d3f | Christian Ehringfeld | private:
|
|
3160499c | Christian Ehringfeld | QString expression;
|
|
506067a2 | Christian Ehringfeld | QHash<QString, QVariant> params;
|
|
3160499c | Christian Ehringfeld | bool onlyColumn;
|
|
};
|
|||
82442988 | Christian Ehringfeld | ||
inline bool operator==(const Expression &e1, const Expression &e2) {
|
|||
return e1.getExpression() == e2.getExpression();
|
|||
}
|
|||
3160499c | Christian Ehringfeld | }
|
|
#endif // EXPRESSION_H
|