53 switch ( value.
type() )
56 case QVariant::LongLong:
57 case QVariant::Double:
61 return value.
toBool() ?
"TRUE" :
"FALSE";
64 case QVariant::String:
98 bool partialCompilation =
false;
99 bool failOnPartialNode =
false;
107 partialCompilation =
true;
224 result =
'(' + left +
' ' + op +
' ' + right +
')';
Class for parsing and evaluation of expressions (formerly called "search strings").
virtual NodeType nodeType() const =0
Abstract virtual that returns the type of this node.
virtual ~QgsSqlExpressionCompiler()
QString & append(QChar ch)
Provider treats LIKE as case-insensitive.
QString & prepend(QChar ch)
virtual Result compile(const QgsExpression *exp)
Compiles an expression and returns the result of the compilation.
Container of fields for a vector layer.
QString join(const QString &separator) const
QVariant value() const
The value of the literal.
const Node * rootNode() const
Returns root node of the expression. Root node is null is parsing has failed.
QgsSqlExpressionCompiler(const QgsFields &fields, const Flags &flags=Flags())
Constructor for expression compiler.
virtual QString quotedValue(const QVariant &value, bool &ok)
Returns a quoted attribute value, in the format expected by the provider.
QString name() const
The name of the column.
virtual QString result()
Returns the compiled expression string for use by the provider.
int indexFromName(const QString &name) const
Look up field's index from name. Returns -1 on error.
BinaryOperator op() const
bool contains(QChar ch, Qt::CaseSensitivity cs) const
QString & replace(int position, int n, QChar after)
Result
Possible results from expression compilation.
Provider performs case-insensitive string matching for all strings.
virtual QString quotedIdentifier(const QString &identifier)
Returns a quoted column identifier, in the format expected by the provider.
virtual Result compileNode(const QgsExpression::Node *node, QString &str)
Compiles an expression node and returns the result of the compilation.
QString arg(qlonglong a, int fieldWidth, int base, const QChar &fillChar) const