| 
    QGIS API Documentation
    3.26.3-Buenos Aires (65e4edfdad)
    
   | 
 
 
 
 
Go to the documentation of this file.
   17 #ifndef QGSEXPRESSIONNODEIMPL_H 
   18 #define QGSEXPRESSIONNODEIMPL_H 
   51     SIP_PYOBJECT __repr__();
 
   53     QString 
str = QStringLiteral( 
"<QgsExpressionNodeUnaryOperator: %1>" ).arg( sipCpp->text() );
 
   54     sipRes = PyUnicode_FromString( 
str.toUtf8().constData() );
 
   71     QString 
dump() 
const override;
 
   76     QList<const QgsExpressionNode *> 
nodes() 
const override; 
SIP_SKIP 
   92     static const 
char *UNARY_OPERATOR_TEXT[];
 
  147       , mOpRight( opRight )
 
  152     SIP_PYOBJECT __repr__();
 
  154     QString 
str = QStringLiteral( 
"<QgsExpressionNodeBinaryOperator: %1>" ).arg( sipCpp->text() );
 
  155     sipRes = PyUnicode_FromString( 
str.toUtf8().constData() );
 
  179     QString 
dump() 
const override;
 
  184     QList<const QgsExpressionNode *> 
nodes( ) 
const override; 
SIP_SKIP 
  193     int precedence() const;
 
  198     bool leftAssociative() const;
 
  204     QString text() const;
 
  207     bool compare( 
double diff );
 
  208     qlonglong computeInt( qlonglong x, qlonglong y );
 
  209     double computeDouble( 
double x, 
double y );
 
  216     QDateTime computeDateTimeFromInterval( const QDateTime &d, 
QgsInterval *i );
 
  222     static const 
char *BINARY_OPERATOR_TEXT[];
 
  238       : mContainer( container )
 
  258     QString 
dump() 
const override;
 
  263     QList<const QgsExpressionNode *> 
nodes( ) 
const override; 
SIP_SKIP 
  290       , mLowerBound( nodeLowerBound )
 
  291       , mHigherBound( nodeHigherBound )
 
  306     QString 
dump() 
const override;
 
  311     QList<const QgsExpressionNode *> 
nodes() 
const override; 
SIP_SKIP 
  335     bool mNegate = false;
 
  375     QString 
dump() 
const override;
 
  380     QList<const QgsExpressionNode *> 
nodes() 
const override; 
SIP_SKIP 
  408     SIP_PYOBJECT __repr__();
 
  413       function = fd->name();
 
  417       function = QString::number( sipCpp->fnIndex() );
 
  420     QString 
str = QStringLiteral( 
"<QgsExpressionNodeFunction: %1>" ).arg( 
function );
 
  421     sipRes = PyUnicode_FromString( 
str.toUtf8().constData() );
 
  438     QString 
dump() 
const override;
 
  444     QList<const QgsExpressionNode *> 
nodes() 
const override; 
SIP_SKIP 
  450     static 
bool validateParams( 
int fnIndex, 
QgsExpressionNode::NodeList *args, QString &error );
 
  454     NodeList *mArgs = 
nullptr;
 
  473     SIP_PYOBJECT __repr__();
 
  475     QString 
str = QStringLiteral( 
"<QgsExpressionNodeLiteral: %1>" ).arg( sipCpp->valueAsString() );
 
  476     sipRes = PyUnicode_FromString( 
str.toUtf8().constData() );
 
  481     inline QVariant 
value()
 const { 
return mValue; }
 
  486     QString 
dump() 
const override;
 
  492     QList<const QgsExpressionNode *> 
nodes() 
const override; 
SIP_SKIP 
  502     QString valueAsString() const;
 
  526     SIP_PYOBJECT __repr__();
 
  528     QString 
str = QStringLiteral( 
"<QgsExpressionNodeColumnRef: \"%1\">" ).arg( sipCpp->name() );
 
  529     sipRes = PyUnicode_FromString( 
str.toUtf8().constData() );
 
  534     QString 
name()
 const { 
return mName; }
 
  539     QString 
dump() 
const override;
 
  544     QList<const QgsExpressionNode *> 
nodes( ) 
const override; 
SIP_SKIP 
  630     QString 
dump() 
const override;
 
  648     QList<const QgsExpressionNode *> 
nodes() 
const override; 
SIP_SKIP 
  660 #endif // QGSEXPRESSIONNODEIMPL_H 
  
virtual QString dump() const =0
Dump this node into a serialized (part) of an expression.
 
Expression contexts are used to encapsulate the parameters around which a QgsExpression should be eva...
 
QgsExpressionNodeBinaryOperator::BinaryOperator op() const
Returns the binary operator.
 
QgsExpressionNode * elseExp() const
The ELSE expression used for the condition.
 
An expression node for literal values.
 
QgsExpressionNodeColumnRef(const QString &name)
Constructor for QgsExpressionNodeColumnRef, referencing the column with the specified name.
 
QSet< QString > referencedFunctions() const override
Returns a set of all functions which are used in this expression.
 
A binary expression operator, which operates on two values.
 
~QgsExpressionNodeIndexOperator() override
 
QgsExpressionNode * node() const
Returns the expression node.
 
bool prepareNode(QgsExpression *parent, const QgsExpressionContext *context) override
Abstract virtual preparation method Errors are reported to the parent.
 
~QgsExpressionNodeBinaryOperator() override
 
NodeType
Known node types.
 
An expression node which takes it value from a feature's field.
 
QVariant value() const
The value of the literal.
 
int fnIndex() const
Returns the index of the node's function.
 
A unary node is either negative as in boolean (not) or as in numbers (minus).
 
virtual QgsExpressionNode * clone() const =0
Generate a clone of this node.
 
An expression node for CASE WHEN clauses.
 
QString dump() const override
Dump this node into a serialized (part) of an expression.
 
QgsExpressionNodeLiteral(const QVariant &value)
Constructor for QgsExpressionNodeLiteral, with the specified literal value.
 
QVariant evalNode(QgsExpression *parent, const QgsExpressionContext *context) override
Abstract virtual eval method Errors are reported to the parent.
 
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.
 
bool needsGeometry() const override
Abstract virtual method which returns if the geometry is required to evaluate this expression.
 
virtual QSet< QString > referencedFunctions() const =0
Returns a set of all functions which are used in this expression.
 
QgsExpressionNodeCondition(QgsExpressionNodeCondition::WhenThenList *conditions, QgsExpressionNode *elseExp=nullptr)
Create a new node with the given list of conditions and an optional elseExp expression.
 
QgsExpressionNode * clone() const override
Generate a clone of this node.
 
QgsExpressionNode::NodeList * args() const
Returns a list of arguments specified for the function.
 
virtual QSet< QString > referencedColumns() const =0
Abstract virtual method which returns a list of columns required to evaluate this node.
 
QgsExpressionNodeBinaryOperator(QgsExpressionNodeBinaryOperator::BinaryOperator op, QgsExpressionNode *opLeft, QgsExpressionNode *opRight)
Binary combination of the left and the right with op.
 
virtual QSet< QString > referencedVariables() const =0
Returns a set of all variables which are used in this expression.
 
virtual bool needsGeometry() const =0
Abstract virtual method which returns if the geometry is required to evaluate this expression.
 
QList< const QgsExpressionNode * > nodes() const override
Returns a list of all nodes which are used in this expression.
 
WhenThenList conditions() const
The list of WHEN THEN expression parts of the expression.
 
SQL-like BETWEEN and NOT BETWEEN predicates.
 
QgsExpressionNode * node() const
Returns the expression node.
 
QgsExpressionNode * whenExp() const
The expression that makes the WHEN part of the condition.
 
An expression node for expression functions.
 
QgsExpressionNodeCondition(const QgsExpressionNodeCondition::WhenThenList &conditions, QgsExpressionNode *elseExp=nullptr)
Create a new node with the given list of conditions and an optional elseExp expression.
 
QgsExpressionNode * thenExp() const
The expression node that makes the THEN result part of the condition.
 
Abstract base class for all nodes that can appear in an expression.
 
UnaryOperator
list of unary operators
 
QgsExpressionNode::NodeType nodeType() const override
Gets the type of this node.
 
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.
 
A abstract base class for defining QgsExpression functions.
 
QgsExpressionNode * opLeft() const
Returns the node to the left of the operator.
 
QgsExpressionNode * index() const
Returns the index node, representing an array element index or map key.
 
A representation of the interval between two datetime values.
 
Represents a "WHEN... THEN..." portation of a CASE WHEN clause in an expression.
 
QgsExpressionNode * container() const
Returns the container node, representing an array or map value.
 
QgsExpressionNode::NodeList * list() const
Returns the list of nodes to search for matching values within.
 
QgsExpressionNode * opRight() const
Returns the node to the right of the operator.
 
QgsExpressionNodeBetweenOperator(QgsExpressionNode *node, QgsExpressionNode *nodeLowerBound, QgsExpressionNode *nodeHigherBound, bool negate=false)
This node tests if the result of node is between the result of nodeLowerBound and nodeHigherBound nod...
 
~QgsExpressionNodeCondition() override
 
virtual QList< const QgsExpressionNode * > nodes() const =0
Returns a list of all nodes which are used in this expression.
 
bool isStatic(QgsExpression *parent, const QgsExpressionContext *context) const override
Returns true if this node can be evaluated for a static value.
 
A indexing expression operator, which allows use of square brackets [] to reference map and array ite...
 
Class for parsing and evaluation of expressions (formerly called "search strings")....
 
QgsExpressionNodeIndexOperator(QgsExpressionNode *container, QgsExpressionNode *index)
Constructor for QgsExpressionNodeIndexOperator.
 
A list of expression nodes.
 
QgsExpressionNodeInOperator(QgsExpressionNode *node, QgsExpressionNode::NodeList *list, bool notin=false)
This node tests if the result of node is in the result of list.
 
QList< QgsExpressionNodeCondition::WhenThen * > WhenThenList
 
virtual QgsExpressionNode::NodeType nodeType() const =0
Gets the type of this node.
 
BinaryOperator
list of binary operators
 
QSet< QString > referencedVariables() const override
Returns a set of all variables which are used in this expression.