QGIS API Documentation  3.26.3-Buenos Aires (65e4edfdad)
qgsexpressionnodeimpl.h
Go to the documentation of this file.
1 /***************************************************************************
2  qgsexpressionnodeimpl.h
3  -------------------
4  begin : May 2017
5  copyright : (C) 2017 Matthias Kuhn
6  email : [email protected]
7  ***************************************************************************
8  * *
9  * This program is free software; you can redistribute it and/or modify *
10  * it under the terms of the GNU General Public License as published by *
11  * the Free Software Foundation; either version 2 of the License, or *
12  * (at your option) any later version. *
13  * *
14  ***************************************************************************/
15 
16 
17 #ifndef QGSEXPRESSIONNODEIMPL_H
18 #define QGSEXPRESSIONNODEIMPL_H
19 
20 #include "qgsexpressionnode.h"
21 #include "qgsinterval.h"
22 
28 {
29  public:
30 
35  enum UnaryOperator
36  {
37  uoNot,
38  uoMinus,
39  };
40 
45  : mOp( op )
46  , mOperand( operand )
47  {}
48  ~QgsExpressionNodeUnaryOperator() override { delete mOperand; }
49 
50 #ifdef SIP_RUN
51  SIP_PYOBJECT __repr__();
52  % MethodCode
53  QString str = QStringLiteral( "<QgsExpressionNodeUnaryOperator: %1>" ).arg( sipCpp->text() );
54  sipRes = PyUnicode_FromString( str.toUtf8().constData() );
55  % End
56 #endif
57 
62 
66  QgsExpressionNode *operand() const { return mOperand; }
67 
68  QgsExpressionNode::NodeType nodeType() const override;
69  bool prepareNode( QgsExpression *parent, const QgsExpressionContext *context ) override;
70  QVariant evalNode( QgsExpression *parent, const QgsExpressionContext *context ) override;
71  QString dump() const override;
72 
73  QSet<QString> referencedColumns() const override;
74  QSet<QString> referencedVariables() const override;
75  QSet<QString> referencedFunctions() const override;
76  QList<const QgsExpressionNode *> nodes() const override; SIP_SKIP
77  bool needsGeometry() const override;
78  QgsExpressionNode *clone() const override SIP_FACTORY;
79 
80  bool isStatic( QgsExpression *parent, const QgsExpressionContext *context ) const override;
81 
86  QString text() const;
87 
88  private:
89  UnaryOperator mOp;
90  QgsExpressionNode *mOperand = nullptr;
91 
92  static const char *UNARY_OPERATOR_TEXT[];
93 };
94 
100 {
101  public:
102 
108  {
109  // logical
112 
113  // comparison
127 
128  // math
136 
137  // strings
139  };
140 
145  : mOp( op )
146  , mOpLeft( opLeft )
147  , mOpRight( opRight )
148  {}
149  ~QgsExpressionNodeBinaryOperator() override { delete mOpLeft; delete mOpRight; }
150 
151 #ifdef SIP_RUN
152  SIP_PYOBJECT __repr__();
153  % MethodCode
154  QString str = QStringLiteral( "<QgsExpressionNodeBinaryOperator: %1>" ).arg( sipCpp->text() );
155  sipRes = PyUnicode_FromString( str.toUtf8().constData() );
156  % End
157 #endif
158 
163 
168  QgsExpressionNode *opLeft() const { return mOpLeft; }
169 
174  QgsExpressionNode *opRight() const { return mOpRight; }
175 
176  QgsExpressionNode::NodeType nodeType() const override;
177  bool prepareNode( QgsExpression *parent, const QgsExpressionContext *context ) override;
178  QVariant evalNode( QgsExpression *parent, const QgsExpressionContext *context ) override;
179  QString dump() const override;
180 
181  QSet<QString> referencedColumns() const override;
182  QSet<QString> referencedVariables() const override;
183  QSet<QString> referencedFunctions() const override;
184  QList<const QgsExpressionNode *> nodes( ) const override; SIP_SKIP
185 
186  bool needsGeometry() const override;
187  QgsExpressionNode *clone() const override SIP_FACTORY;
188  bool isStatic( QgsExpression *parent, const QgsExpressionContext *context ) const override;
189 
193  int precedence() const;
194 
198  bool leftAssociative() const;
199 
204  QString text() const;
205 
206  private:
207  bool compare( double diff );
208  qlonglong computeInt( qlonglong x, qlonglong y );
209  double computeDouble( double x, double y );
210 
216  QDateTime computeDateTimeFromInterval( const QDateTime &d, QgsInterval *i );
217 
218  BinaryOperator mOp;
219  QgsExpressionNode *mOpLeft = nullptr;
220  QgsExpressionNode *mOpRight = nullptr;
221 
222  static const char *BINARY_OPERATOR_TEXT[];
223 };
224 
231 {
232  public:
233 
238  : mContainer( container )
239  , mIndex( index )
240  {}
241  ~QgsExpressionNodeIndexOperator() override { delete mContainer; delete mIndex; }
242 
247  QgsExpressionNode *container() const { return mContainer; }
248 
253  QgsExpressionNode *index() const { return mIndex; }
254 
255  QgsExpressionNode::NodeType nodeType() const override;
256  bool prepareNode( QgsExpression *parent, const QgsExpressionContext *context ) override;
257  QVariant evalNode( QgsExpression *parent, const QgsExpressionContext *context ) override;
258  QString dump() const override;
259 
260  QSet<QString> referencedColumns() const override;
261  QSet<QString> referencedVariables() const override;
262  QSet<QString> referencedFunctions() const override;
263  QList<const QgsExpressionNode *> nodes( ) const override; SIP_SKIP
264 
265  bool needsGeometry() const override;
266  QgsExpressionNode *clone() const override SIP_FACTORY;
267  bool isStatic( QgsExpression *parent, const QgsExpressionContext *context ) const override;
268 
269  private:
270 
271  QgsExpressionNode *mContainer = nullptr;
272  QgsExpressionNode *mIndex = nullptr;
273 
274 };
275 
282 {
283  public:
284 
289  : mNode( node )
290  , mLowerBound( nodeLowerBound )
291  , mHigherBound( nodeHigherBound )
292  , mNegate( negate )
293  {}
294 
296 
300  QgsExpressionNode *node() const { return mNode; }
301 
302 
303  QgsExpressionNode::NodeType nodeType() const override;
304  bool prepareNode( QgsExpression *parent, const QgsExpressionContext *context ) override;
305  QVariant evalNode( QgsExpression *parent, const QgsExpressionContext *context ) override;
306  QString dump() const override;
307 
308  QSet<QString> referencedColumns() const override;
309  QSet<QString> referencedVariables() const override;
310  QSet<QString> referencedFunctions() const override;
311  QList<const QgsExpressionNode *> nodes() const override; SIP_SKIP
312  bool needsGeometry() const override;
313  QgsExpressionNode *clone() const override SIP_FACTORY;
314  bool isStatic( QgsExpression *parent, const QgsExpressionContext *context ) const override;
315 
319  QgsExpressionNode *lowerBound() const;
320 
324  QgsExpressionNode *higherBound() const;
325 
329  bool negate() const;
330 
331  private:
332  QgsExpressionNode *mNode = nullptr;
333  QgsExpressionNode *mLowerBound = nullptr;
334  QgsExpressionNode *mHigherBound = nullptr;
335  bool mNegate = false;
336 
337 };
338 
344 {
345  public:
346 
351  : mNode( node )
352  , mList( list )
353  , mNotIn( notin )
354  {}
355  ~QgsExpressionNodeInOperator() override;
356 
360  QgsExpressionNode *node() const { return mNode; }
361 
365  bool isNotIn() const { return mNotIn; }
366 
370  QgsExpressionNode::NodeList *list() const { return mList; }
371 
372  QgsExpressionNode::NodeType nodeType() const override;
373  bool prepareNode( QgsExpression *parent, const QgsExpressionContext *context ) override;
374  QVariant evalNode( QgsExpression *parent, const QgsExpressionContext *context ) override;
375  QString dump() const override;
376 
377  QSet<QString> referencedColumns() const override;
378  QSet<QString> referencedVariables() const override;
379  QSet<QString> referencedFunctions() const override;
380  QList<const QgsExpressionNode *> nodes() const override; SIP_SKIP
381  bool needsGeometry() const override;
382  QgsExpressionNode *clone() const override SIP_FACTORY;
383  bool isStatic( QgsExpression *parent, const QgsExpressionContext *context ) const override;
384 
385  private:
386  QgsExpressionNode *mNode = nullptr;
387  QgsExpressionNodeInOperator::NodeList *mList = nullptr;
388  bool mNotIn;
389 };
390 
396 {
397  public:
398 
404 
405  ~QgsExpressionNodeFunction() override;
406 
407 #ifdef SIP_RUN
408  SIP_PYOBJECT __repr__();
409  % MethodCode
410  QString function;
411  if ( QgsExpressionFunction *fd = QgsExpression::QgsExpression::Functions()[sipCpp->fnIndex()] )
412  {
413  function = fd->name();
414  }
415  else
416  {
417  function = QString::number( sipCpp->fnIndex() );
418  }
419 
420  QString str = QStringLiteral( "<QgsExpressionNodeFunction: %1>" ).arg( function );
421  sipRes = PyUnicode_FromString( str.toUtf8().constData() );
422  % End
423 #endif
424 
428  int fnIndex() const { return mFnIndex; }
429 
433  QgsExpressionNode::NodeList *args() const { return mArgs; }
434 
435  QgsExpressionNode::NodeType nodeType() const override;
436  bool prepareNode( QgsExpression *parent, const QgsExpressionContext *context ) override;
437  QVariant evalNode( QgsExpression *parent, const QgsExpressionContext *context ) override;
438  QString dump() const override;
439 
440  QSet<QString> referencedColumns() const override;
441  QSet<QString> referencedVariables() const override;
442  QSet<QString> referencedFunctions() const override;
443 
444  QList<const QgsExpressionNode *> nodes() const override; SIP_SKIP
445  bool needsGeometry() const override;
446  QgsExpressionNode *clone() const override SIP_FACTORY;
447  bool isStatic( QgsExpression *parent, const QgsExpressionContext *context ) const override;
448 
450  static bool validateParams( int fnIndex, QgsExpressionNode::NodeList *args, QString &error );
451 
452  private:
453  int mFnIndex;
454  NodeList *mArgs = nullptr;
455 };
456 
461 class CORE_EXPORT QgsExpressionNodeLiteral : public QgsExpressionNode
462 {
463  public:
464 
468  QgsExpressionNodeLiteral( const QVariant &value )
469  : mValue( value )
470  {}
471 
472 #ifdef SIP_RUN
473  SIP_PYOBJECT __repr__();
474  % MethodCode
475  QString str = QStringLiteral( "<QgsExpressionNodeLiteral: %1>" ).arg( sipCpp->valueAsString() );
476  sipRes = PyUnicode_FromString( str.toUtf8().constData() );
477  % End
478 #endif
479 
481  inline QVariant value() const { return mValue; }
482 
483  QgsExpressionNode::NodeType nodeType() const override;
484  bool prepareNode( QgsExpression *parent, const QgsExpressionContext *context ) override;
485  QVariant evalNode( QgsExpression *parent, const QgsExpressionContext *context ) override;
486  QString dump() const override;
487 
488  QSet<QString> referencedColumns() const override;
489  QSet<QString> referencedVariables() const override;
490  QSet<QString> referencedFunctions() const override;
491 
492  QList<const QgsExpressionNode *> nodes() const override; SIP_SKIP
493  bool needsGeometry() const override;
494  QgsExpressionNode *clone() const override SIP_FACTORY;
495  bool isStatic( QgsExpression *parent, const QgsExpressionContext *context ) const override;
496 
502  QString valueAsString() const;
503 
504  private:
505  QVariant mValue;
506 };
507 
513 {
514  public:
515 
520  QgsExpressionNodeColumnRef( const QString &name )
521  : mName( name )
522  , mIndex( -1 )
523  {}
524 
525 #ifdef SIP_RUN
526  SIP_PYOBJECT __repr__();
527  % MethodCode
528  QString str = QStringLiteral( "<QgsExpressionNodeColumnRef: \"%1\">" ).arg( sipCpp->name() );
529  sipRes = PyUnicode_FromString( str.toUtf8().constData() );
530  % End
531 #endif
532 
534  QString name() const { return mName; }
535 
536  QgsExpressionNode::NodeType nodeType() const override;
537  bool prepareNode( QgsExpression *parent, const QgsExpressionContext *context ) override;
538  QVariant evalNode( QgsExpression *parent, const QgsExpressionContext *context ) override;
539  QString dump() const override;
540 
541  QSet<QString> referencedColumns() const override;
542  QSet<QString> referencedVariables() const override;
543  QSet<QString> referencedFunctions() const override;
544  QList<const QgsExpressionNode *> nodes( ) const override; SIP_SKIP
545 
546  bool needsGeometry() const override;
547 
548  QgsExpressionNode *clone() const override SIP_FACTORY;
549  bool isStatic( QgsExpression *parent, const QgsExpressionContext *context ) const override;
550 
551  private:
552  QString mName;
553  int mIndex;
554 };
555 
561 {
562  public:
563 
568  class CORE_EXPORT WhenThen
569  {
570  public:
571 
575  WhenThen( QgsExpressionNode *whenExp, QgsExpressionNode *thenExp );
576  ~WhenThen();
577 
579  WhenThen( const WhenThen &rh ) = delete;
581  WhenThen &operator=( const WhenThen &rh ) = delete;
582 
587 
592  QgsExpressionNode *whenExp() const { return mWhenExp; }
593 
599  QgsExpressionNode *thenExp() const { return mThenExp; }
600 
601  private:
602 #ifdef SIP_RUN
604 #endif
605  QgsExpressionNode *mWhenExp = nullptr;
606  QgsExpressionNode *mThenExp = nullptr;
607 
609  };
610  typedef QList<QgsExpressionNodeCondition::WhenThen *> WhenThenList;
611 
616 
621  : mConditions( conditions )
622  , mElseExp( elseExp )
623  {}
624 
625  ~QgsExpressionNodeCondition() override;
626 
627  QgsExpressionNode::NodeType nodeType() const override;
628  QVariant evalNode( QgsExpression *parent, const QgsExpressionContext *context ) override;
629  bool prepareNode( QgsExpression *parent, const QgsExpressionContext *context ) override;
630  QString dump() const override;
631 
636  WhenThenList conditions() const { return mConditions; }
637 
642  QgsExpressionNode *elseExp() const { return mElseExp; }
643 
644  QSet<QString> referencedColumns() const override;
645  QSet<QString> referencedVariables() const override;
646  QSet<QString> referencedFunctions() const override;
647 
648  QList<const QgsExpressionNode *> nodes() const override; SIP_SKIP
649 
650  bool needsGeometry() const override;
651  QgsExpressionNode *clone() const override SIP_FACTORY;
652  bool isStatic( QgsExpression *parent, const QgsExpressionContext *context ) const override;
653 
654  private:
655  WhenThenList mConditions;
656  QgsExpressionNode *mElseExp = nullptr;
657 };
658 
659 
660 #endif // QGSEXPRESSIONNODEIMPL_H
QgsExpressionNode::dump
virtual QString dump() const =0
Dump this node into a serialized (part) of an expression.
QgsExpressionContext
Expression contexts are used to encapsulate the parameters around which a QgsExpression should be eva...
Definition: qgsexpressioncontext.h:406
QgsExpressionNodeBinaryOperator::op
QgsExpressionNodeBinaryOperator::BinaryOperator op() const
Returns the binary operator.
Definition: qgsexpressionnodeimpl.h:162
QgsExpressionNodeCondition::elseExp
QgsExpressionNode * elseExp() const
The ELSE expression used for the condition.
Definition: qgsexpressionnodeimpl.h:642
QgsExpressionNodeBinaryOperator::boILike
@ boILike
Definition: qgsexpressionnodeimpl.h:123
QgsExpressionNodeBinaryOperator::boPlus
@ boPlus
Definition: qgsexpressionnodeimpl.h:129
QgsExpressionNodeLiteral
An expression node for literal values.
Definition: qgsexpressionnodeimpl.h:461
QgsExpressionNodeColumnRef::QgsExpressionNodeColumnRef
QgsExpressionNodeColumnRef(const QString &name)
Constructor for QgsExpressionNodeColumnRef, referencing the column with the specified name.
Definition: qgsexpressionnodeimpl.h:520
QgsExpressionNodeCondition::referencedFunctions
QSet< QString > referencedFunctions() const override
Returns a set of all functions which are used in this expression.
Definition: qgsexpressionnodeimpl.cpp:1689
QgsExpressionNodeBinaryOperator
A binary expression operator, which operates on two values.
Definition: qgsexpressionnodeimpl.h:99
QgsExpressionNodeIndexOperator::~QgsExpressionNodeIndexOperator
~QgsExpressionNodeIndexOperator() override
Definition: qgsexpressionnodeimpl.h:241
QgsExpressionNodeInOperator::node
QgsExpressionNode * node() const
Returns the expression node.
Definition: qgsexpressionnodeimpl.h:360
QgsExpressionNodeCondition::prepareNode
bool prepareNode(QgsExpression *parent, const QgsExpressionContext *context) override
Abstract virtual preparation method Errors are reported to the parent.
Definition: qgsexpressionnodeimpl.cpp:1585
QgsExpressionNodeBinaryOperator::boRegexp
@ boRegexp
Definition: qgsexpressionnodeimpl.h:120
QgsExpressionNodeBinaryOperator::boLE
@ boLE
<=
Definition: qgsexpressionnodeimpl.h:116
QgsExpressionNodeBinaryOperator::~QgsExpressionNodeBinaryOperator
~QgsExpressionNodeBinaryOperator() override
Definition: qgsexpressionnodeimpl.h:149
QgsExpressionNode::NodeType
NodeType
Known node types.
Definition: qgsexpressionnode.h:77
qgsinterval.h
QgsExpressionNodeBinaryOperator::boGE
@ boGE
>=
Definition: qgsexpressionnodeimpl.h:117
QgsExpressionNodeColumnRef
An expression node which takes it value from a feature's field.
Definition: qgsexpressionnodeimpl.h:512
QgsExpressionNodeLiteral::value
QVariant value() const
The value of the literal.
Definition: qgsexpressionnodeimpl.h:481
QgsExpressionNodeFunction::fnIndex
int fnIndex() const
Returns the index of the node's function.
Definition: qgsexpressionnodeimpl.h:428
QgsExpressionNodeUnaryOperator
A unary node is either negative as in boolean (not) or as in numbers (minus).
Definition: qgsexpressionnodeimpl.h:27
QgsExpressionNode::clone
virtual QgsExpressionNode * clone() const =0
Generate a clone of this node.
QgsExpressionNodeCondition
An expression node for CASE WHEN clauses.
Definition: qgsexpressionnodeimpl.h:560
QgsExpressionNodeCondition::dump
QString dump() const override
Dump this node into a serialized (part) of an expression.
Definition: qgsexpressionnodeimpl.cpp:1645
QgsExpressionNodeLiteral::QgsExpressionNodeLiteral
QgsExpressionNodeLiteral(const QVariant &value)
Constructor for QgsExpressionNodeLiteral, with the specified literal value.
Definition: qgsexpressionnodeimpl.h:468
QgsExpressionNodeCondition::evalNode
QVariant evalNode(QgsExpression *parent, const QgsExpressionContext *context) override
Abstract virtual eval method Errors are reported to the parent.
Definition: qgsexpressionnodeimpl.cpp:1559
QgsExpressionNodeBinaryOperator::boMod
@ boMod
Definition: qgsexpressionnodeimpl.h:134
QgsExpressionNodeInOperator
An expression node for value IN or NOT IN clauses.
Definition: qgsexpressionnodeimpl.h:343
QgsExpressionNodeCondition::referencedColumns
QSet< QString > referencedColumns() const override
Abstract virtual method which returns a list of columns required to evaluate this node.
Definition: qgsexpressionnodeimpl.cpp:1658
SIP_FACTORY
#define SIP_FACTORY
Definition: qgis_sip.h:76
QgsExpressionNodeBinaryOperator::boMinus
@ boMinus
Definition: qgsexpressionnodeimpl.h:130
QgsExpressionNodeCondition::needsGeometry
bool needsGeometry() const override
Abstract virtual method which returns if the geometry is required to evaluate this expression.
Definition: qgsexpressionnodeimpl.cpp:1718
QgsExpressionNode::referencedFunctions
virtual QSet< QString > referencedFunctions() const =0
Returns a set of all functions which are used in this expression.
QgsExpressionNodeCondition::QgsExpressionNodeCondition
QgsExpressionNodeCondition(QgsExpressionNodeCondition::WhenThenList *conditions, QgsExpressionNode *elseExp=nullptr)
Create a new node with the given list of conditions and an optional elseExp expression.
Definition: qgsexpressionnodeimpl.cpp:1541
SIP_SKIP
#define SIP_SKIP
Definition: qgis_sip.h:126
QgsExpressionNodeBinaryOperator::boPow
@ boPow
Definition: qgsexpressionnodeimpl.h:135
QgsExpressionNodeCondition::clone
QgsExpressionNode * clone() const override
Generate a clone of this node.
Definition: qgsexpressionnodeimpl.cpp:1730
QgsExpressionNodeFunction::args
QgsExpressionNode::NodeList * args() const
Returns a list of arguments specified for the function.
Definition: qgsexpressionnodeimpl.h:433
QgsExpressionNodeBinaryOperator::boConcat
@ boConcat
Definition: qgsexpressionnodeimpl.h:138
QgsExpressionNode::referencedColumns
virtual QSet< QString > referencedColumns() const =0
Abstract virtual method which returns a list of columns required to evaluate this node.
QgsExpressionNodeBinaryOperator::QgsExpressionNodeBinaryOperator
QgsExpressionNodeBinaryOperator(QgsExpressionNodeBinaryOperator::BinaryOperator op, QgsExpressionNode *opLeft, QgsExpressionNode *opRight)
Binary combination of the left and the right with op.
Definition: qgsexpressionnodeimpl.h:144
QgsExpressionNode::referencedVariables
virtual QSet< QString > referencedVariables() const =0
Returns a set of all variables which are used in this expression.
QgsExpressionNode::needsGeometry
virtual bool needsGeometry() const =0
Abstract virtual method which returns if the geometry is required to evaluate this expression.
QgsExpressionNodeCondition::nodes
QList< const QgsExpressionNode * > nodes() const override
Returns a list of all nodes which are used in this expression.
Definition: qgsexpressionnodeimpl.cpp:1703
QgsExpressionNodeCondition::conditions
WhenThenList conditions() const
The list of WHEN THEN expression parts of the expression.
Definition: qgsexpressionnodeimpl.h:636
qgsexpressionnode.h
SIP_TRANSFER
#define SIP_TRANSFER
Definition: qgis_sip.h:36
QgsExpressionNodeBinaryOperator::boLT
@ boLT
<
Definition: qgsexpressionnodeimpl.h:118
QgsExpressionNodeBinaryOperator::boNotILike
@ boNotILike
Definition: qgsexpressionnodeimpl.h:124
QgsExpressionNodeBetweenOperator
SQL-like BETWEEN and NOT BETWEEN predicates.
Definition: qgsexpressionnodeimpl.h:281
QgsExpressionNodeBetweenOperator::node
QgsExpressionNode * node() const
Returns the expression node.
Definition: qgsexpressionnodeimpl.h:300
QgsExpressionNodeCondition::WhenThen::whenExp
QgsExpressionNode * whenExp() const
The expression that makes the WHEN part of the condition.
Definition: qgsexpressionnodeimpl.h:592
QgsExpressionNodeFunction
An expression node for expression functions.
Definition: qgsexpressionnodeimpl.h:395
QgsExpressionNodeCondition::QgsExpressionNodeCondition
QgsExpressionNodeCondition(const QgsExpressionNodeCondition::WhenThenList &conditions, QgsExpressionNode *elseExp=nullptr)
Create a new node with the given list of conditions and an optional elseExp expression.
Definition: qgsexpressionnodeimpl.h:620
QgsExpressionNodeBinaryOperator::boNE
@ boNE
<>
Definition: qgsexpressionnodeimpl.h:115
QgsExpressionNodeBinaryOperator::boIsNot
@ boIsNot
Definition: qgsexpressionnodeimpl.h:126
QgsExpressionNodeBinaryOperator::boLike
@ boLike
Definition: qgsexpressionnodeimpl.h:121
QgsExpressionNodeCondition::WhenThen::thenExp
QgsExpressionNode * thenExp() const
The expression node that makes the THEN result part of the condition.
Definition: qgsexpressionnodeimpl.h:599
QgsExpressionNodeBinaryOperator::boNotLike
@ boNotLike
Definition: qgsexpressionnodeimpl.h:122
QgsExpressionNode
Abstract base class for all nodes that can appear in an expression.
Definition: qgsexpressionnode.h:34
QgsExpressionNodeUnaryOperator::UnaryOperator
UnaryOperator
list of unary operators
Definition: qgsexpressionnodeimpl.h:48
QgsExpressionNodeCondition::nodeType
QgsExpressionNode::NodeType nodeType() const override
Gets the type of this node.
Definition: qgsexpressionnodeimpl.cpp:1554
QgsExpressionNodeBinaryOperator::boEQ
@ boEQ
=
Definition: qgsexpressionnodeimpl.h:114
QgsExpressionNodeBinaryOperator::boIntDiv
@ boIntDiv
Definition: qgsexpressionnodeimpl.h:133
QgsExpressionNodeBinaryOperator::boIs
@ boIs
Definition: qgsexpressionnodeimpl.h:125
QgsExpressionNodeBinaryOperator::boGT
@ boGT
Definition: qgsexpressionnodeimpl.h:119
QgsExpressionNodeInOperator::isNotIn
bool isNotIn() const
Returns true if this node is a "NOT IN" operator, or false if the node is a normal "IN" operator.
Definition: qgsexpressionnodeimpl.h:365
QgsExpressionNodeColumnRef::name
QString name() const
The name of the column.
Definition: qgsexpressionnodeimpl.h:534
QgsExpressionFunction
A abstract base class for defining QgsExpression functions.
Definition: qgsexpressionfunction.h:40
str
#define str(x)
Definition: qgis.cpp:37
QgsExpressionNodeBinaryOperator::opLeft
QgsExpressionNode * opLeft() const
Returns the node to the left of the operator.
Definition: qgsexpressionnodeimpl.h:168
QgsExpressionNodeIndexOperator::index
QgsExpressionNode * index() const
Returns the index node, representing an array element index or map key.
Definition: qgsexpressionnodeimpl.h:253
QgsInterval
A representation of the interval between two datetime values.
Definition: qgsinterval.h:41
QgsExpressionNodeCondition::WhenThen
Represents a "WHEN... THEN..." portation of a CASE WHEN clause in an expression.
Definition: qgsexpressionnodeimpl.h:568
QgsExpressionNodeIndexOperator::container
QgsExpressionNode * container() const
Returns the container node, representing an array or map value.
Definition: qgsexpressionnodeimpl.h:247
QgsExpressionNodeBinaryOperator::boDiv
@ boDiv
Definition: qgsexpressionnodeimpl.h:132
QgsExpressionNodeInOperator::list
QgsExpressionNode::NodeList * list() const
Returns the list of nodes to search for matching values within.
Definition: qgsexpressionnodeimpl.h:370
QgsExpressionNodeBinaryOperator::opRight
QgsExpressionNode * opRight() const
Returns the node to the right of the operator.
Definition: qgsexpressionnodeimpl.h:174
QgsExpressionNodeBinaryOperator::boAnd
@ boAnd
Definition: qgsexpressionnodeimpl.h:111
QgsExpressionNodeBetweenOperator::QgsExpressionNodeBetweenOperator
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...
Definition: qgsexpressionnodeimpl.h:288
QgsExpressionNodeCondition::~QgsExpressionNodeCondition
~QgsExpressionNodeCondition() override
Definition: qgsexpressionnodeimpl.cpp:1548
QgsExpressionNode::nodes
virtual QList< const QgsExpressionNode * > nodes() const =0
Returns a list of all nodes which are used in this expression.
QgsExpressionNodeBinaryOperator::boMul
@ boMul
Definition: qgsexpressionnodeimpl.h:131
QgsExpressionNodeCondition::isStatic
bool isStatic(QgsExpression *parent, const QgsExpressionContext *context) const override
Returns true if this node can be evaluated for a static value.
Definition: qgsexpressionnodeimpl.cpp:1742
QgsExpressionNodeBinaryOperator::boOr
@ boOr
Definition: qgsexpressionnodeimpl.h:110
QgsExpressionNodeIndexOperator
A indexing expression operator, which allows use of square brackets [] to reference map and array ite...
Definition: qgsexpressionnodeimpl.h:230
QgsExpression
Class for parsing and evaluation of expressions (formerly called "search strings")....
Definition: qgsexpression.h:102
QgsExpressionNodeIndexOperator::QgsExpressionNodeIndexOperator
QgsExpressionNodeIndexOperator(QgsExpressionNode *container, QgsExpressionNode *index)
Constructor for QgsExpressionNodeIndexOperator.
Definition: qgsexpressionnodeimpl.h:237
QgsExpressionNode::NodeList
A list of expression nodes.
Definition: qgsexpressionnode.h:121
QgsExpressionNodeInOperator::QgsExpressionNodeInOperator
QgsExpressionNodeInOperator(QgsExpressionNode *node, QgsExpressionNode::NodeList *list, bool notin=false)
This node tests if the result of node is in the result of list.
Definition: qgsexpressionnodeimpl.h:350
QgsExpressionNodeCondition::WhenThenList
QList< QgsExpressionNodeCondition::WhenThen * > WhenThenList
Definition: qgsexpressionnodeimpl.h:610
QgsExpressionNode::nodeType
virtual QgsExpressionNode::NodeType nodeType() const =0
Gets the type of this node.
QgsExpressionNodeBinaryOperator::BinaryOperator
BinaryOperator
list of binary operators
Definition: qgsexpressionnodeimpl.h:107
QgsExpressionNodeCondition::referencedVariables
QSet< QString > referencedVariables() const override
Returns a set of all variables which are used in this expression.
Definition: qgsexpressionnodeimpl.cpp:1675