17 #ifndef QGSEXPRESSIONNODEIMPL_H 18 #define QGSEXPRESSIONNODEIMPL_H 63 QString
dump()
const override;
68 QList<const QgsExpressionNode *>
nodes()
const override;
SIP_SKIP 84 static const char *UNARY_OPERATOR_TEXT[];
139 , mOpRight( opRight )
163 QString
dump()
const override;
168 QList<const QgsExpressionNode *>
nodes( )
const override;
SIP_SKIP 177 int precedence()
const;
182 bool leftAssociative()
const;
188 QString text()
const;
191 bool compare(
double diff );
192 qlonglong computeInt( qlonglong x, qlonglong y );
193 double computeDouble(
double x,
double y );
200 QDateTime computeDateTimeFromInterval(
const QDateTime &d,
QgsInterval *i );
206 static const char *BINARY_OPERATOR_TEXT[];
245 QString
dump()
const override;
250 QList<const QgsExpressionNode *>
nodes()
const override;
SIP_SKIP 290 QString
dump()
const override;
296 QList<const QgsExpressionNode *>
nodes()
const override;
SIP_SKIP 325 inline QVariant
value()
const {
return mValue; }
330 QString
dump()
const override;
336 QList<const QgsExpressionNode *>
nodes()
const override;
SIP_SKIP 363 QString
name()
const {
return mName; }
368 QString
dump()
const override;
373 QList<const QgsExpressionNode *>
nodes( )
const override;
SIP_SKIP 450 : mConditions( conditions )
459 QString
dump()
const override;
477 QList<const QgsExpressionNode *>
nodes()
const override;
SIP_SKIP 484 WhenThenList mConditions;
489 #endif // QGSEXPRESSIONNODEIMPL_H Class for parsing and evaluation of expressions (formerly called "search strings").
QgsExpressionNode * thenExp() const
The expression node that makes the THEN result part of the condition.
QgsExpressionNodeBinaryOperator::BinaryOperator op() const
Returns the binary operator.
QgsExpressionNodeCondition(const QgsExpressionNodeCondition::WhenThenList &conditions, QgsExpressionNode *elseExp=nullptr)
Create a new node with the given list of conditions and an optional elseExp expression.
virtual QString dump() const =0
Dump this node into a serialized (part) of an expression.
QgsExpressionNodeCondition(QgsExpressionNodeCondition::WhenThenList *conditions, QgsExpressionNode *elseExp=nullptr)
Create a new node with the given list of conditions and an optional elseExp expression.
QgsExpressionNode * whenExp() const
The expression that makes the WHEN part of the condition.
QgsExpressionNodeColumnRef(const QString &name)
Constructor for QgsExpressionNodeColumnRef, referencing the column with the specified name...
int fnIndex() const
Returns the index of the node's function.
NodeType
Known node types.
QgsExpressionNodeInOperator(QgsExpressionNode *node, QgsExpressionNode::NodeList *list, bool notin=false)
This node tests if the result of node is in the result of list.
An expression node for CASE WHEN clauses.
bool isNotIn() const
Returns true if this node is a "NOT IN" operator, or false if the node is a normal "IN" operator...
QString name() const
The name of the column.
virtual QgsExpressionNode * clone() const =0
Generate a clone of this node.
QgsExpressionNode * elseExp() const
The ELSE expression used for the condition.
QgsExpressionNode * node() const
Returns the expression node.
QgsExpressionNode::NodeList * list() const
Returns the list of nodes to search for matching values within.
QgsExpressionNode::NodeList * args() const
Returns a list of arguments specified for the function.
QgsExpressionNode::NodeType nodeType() const override
Gets the type of this node.
QSet< QString > referencedFunctions() const override
Returns a set of all functions which are used in this expression.
virtual QSet< QString > referencedColumns() const =0
Abstract virtual method which returns a list of columns required to evaluate this node...
~QgsExpressionNodeBinaryOperator() override
virtual QSet< QString > referencedVariables() const =0
Returns a set of all variables which are used in this expression.
QList< const QgsExpressionNode * > nodes() const override
Returns a list of all nodes which are used in this expression.
Expression contexts are used to encapsulate the parameters around which a QgsExpression should be eva...
BinaryOperator
list of binary operators
An expression node for value IN or NOT IN clauses.
QSet< QString > referencedColumns() const override
Abstract virtual method which returns a list of columns required to evaluate this node...
QgsExpressionNode * clone() const override
Generate a clone of this node.
An expression node which takes it value from a feature's field.
virtual QSet< QString > referencedFunctions() const =0
Returns a set of all functions which are used in this expression.
Abstract base class for all nodes that can appear in an expression.
~QgsExpressionNodeCondition() override
An expression node for expression functions.
bool prepareNode(QgsExpression *parent, const QgsExpressionContext *context) override
Abstract virtual preparation method Errors are reported to the parent.
WhenThenList conditions() const
The list of WHEN THEN expression parts of the expression.
QgsExpressionNode * operand() const
Returns the node the operator will operate upon.
QVariant evalNode(QgsExpression *parent, const QgsExpressionContext *context) override
Abstract virtual eval method Errors are reported to the parent.
QList< QgsExpressionNodeCondition::WhenThen * > WhenThenList
QgsExpressionNodeUnaryOperator(QgsExpressionNodeUnaryOperator::UnaryOperator op, QgsExpressionNode *operand)
A node unary operator is modifying the value of operand by negating it with op.
bool isStatic(QgsExpression *parent, const QgsExpressionContext *context) const override
Returns true if this node can be evaluated for a static value.
A representation of the interval between two datetime values.
virtual bool needsGeometry() const =0
Abstract virtual method which returns if the geometry is required to evaluate this expression...
A list of expression nodes.
QVariant value() const
The value of the literal.
QgsExpressionNodeLiteral(const QVariant &value)
Constructor for QgsExpressionNodeLiteral, with the specified literal value.
An expression node for literal values.
A unary node is either negative as in boolean (not) or as in numbers (minus).
QgsExpressionNode * opLeft() const
Returns the node to the left of the operator.
A binary expression operator, which operates on two values.
QString dump() const override
Dump this node into a serialized (part) of an expression.
virtual bool isStatic(QgsExpression *parent, const QgsExpressionContext *context) const =0
Returns true if this node can be evaluated for a static value.
QgsExpressionNode * opRight() const
Returns the node to the right of the operator.
~QgsExpressionNodeUnaryOperator() override
virtual QList< const QgsExpressionNode * > nodes() const =0
Returns a list of all nodes which are used in this expression.
virtual QgsExpressionNode::NodeType nodeType() const =0
Gets the type of this node.
QSet< QString > referencedVariables() const override
Returns a set of all variables which are used in this expression.
QgsExpressionNodeUnaryOperator::UnaryOperator op() const
Returns the unary operator.
Represents a "WHEN... THEN..." portation of a CASE WHEN clause in an expression.
UnaryOperator
list of unary operators
bool needsGeometry() const override
Abstract virtual method which returns if the geometry is required to evaluate this expression...
QgsExpressionNodeBinaryOperator(QgsExpressionNodeBinaryOperator::BinaryOperator op, QgsExpressionNode *opLeft, QgsExpressionNode *opRight)
Binary combination of the left and the right with op.