QGIS API Documentation 4.3.0-Master (bd2f5e21fd1)
Loading...
Searching...
No Matches
QgsEsriArcadeForInStatement Class Reference

Represents a range based for...in or for...of iteration statement. More...

#include <qgsesriarcadescript.h>

Inheritance diagram for QgsEsriArcadeForInStatement:

Public Types

enum class  IterationType { ForIn , ForOf }
 Type of iteration loop. More...
Public Types inherited from QgsEsriArcadeNode
enum class  NodeType {
  BlockStatement , VariableDeclarationStatement , ReturnStatement , AssignmentStatement ,
  FunctionDeclarationStatement , ExpressionStatement , LiteralExpression , VariableReferenceExpression ,
  ProfileVariableReferenceExpression , MemberAccessExpression , BinaryOperatorExpression , UnaryOperatorExpression ,
  FunctionCallExpression , IndexExpression , ArrayLiteralExpression , DictionaryLiteralExpression ,
  IfStatement , ForStatement , ForInStatement , WhileStatement ,
  BreakStatement , ContinueStatement
}
 Node type identifier. More...

Public Member Functions

 QgsEsriArcadeForInStatement (IterationType iterationType, const QString &variableName, bool isVariableDeclaration, QgsEsriArcadeExpression *collection, QgsEsriArcadeBlockStatement *body)
 Constructor for QgsEsriArcadeForInStatement.
void accept (QgsEsriArcadeVisitor &visitor) const override
 Accepts a visitor to traverse the node.
QgsEsriArcadeBlockStatement * body () const
 Returns the loop body block statement.
QgsEsriArcadeNode * clone () const override
 Creates a copy of the node.
QgsEsriArcadeExpression * collection () const
 Returns the collection expression being iterated over.
QString dump () const override
 Returns the formatted script representation of the node.
bool isVariableDeclaration () const
 Returns true if the loop variable was declared with the var keyword.
IterationType iterationType () const
 Returns the iteration type (for...in or for...of).
QgsEsriArcadeNode::NodeType nodeType () const override
 Returns the node type.
QString variableName () const
 Returns the loop variable identifier name.
Public Member Functions inherited from QgsEsriArcadeStatement
 ~QgsEsriArcadeStatement () override=default
Public Member Functions inherited from QgsEsriArcadeNode
virtual ~QgsEsriArcadeNode ()=default

Detailed Description

Represents a range based for...in or for...of iteration statement.

Since
QGIS 4.4

Definition at line 1186 of file qgsesriarcadescript.h.

Member Enumeration Documentation

◆ IterationType

Type of iteration loop.

Enumerator
ForIn 

For x in y loop.

ForOf 

For x of y loop.

Definition at line 1192 of file qgsesriarcadescript.h.

Constructor & Destructor Documentation

◆ QgsEsriArcadeForInStatement()

QgsEsriArcadeForInStatement::QgsEsriArcadeForInStatement ( IterationType iterationType,
const QString & variableName,
bool isVariableDeclaration,
QgsEsriArcadeExpression * collection,
QgsEsriArcadeBlockStatement * body )

Constructor for QgsEsriArcadeForInStatement.

Ownership of collection and body is transferred to this statement.

Definition at line 715 of file qgsesriarcadescript.cpp.

Member Function Documentation

◆ accept()

void QgsEsriArcadeForInStatement::accept ( QgsEsriArcadeVisitor & visitor) const
overridevirtual

Accepts a visitor to traverse the node.

Implements QgsEsriArcadeNode.

Definition at line 738 of file qgsesriarcadescript.cpp.

◆ body()

QgsEsriArcadeBlockStatement * QgsEsriArcadeForInStatement::body ( ) const
inline

Returns the loop body block statement.

Definition at line 1235 of file qgsesriarcadescript.h.

◆ clone()

QgsEsriArcadeNode * QgsEsriArcadeForInStatement::clone ( ) const
overridevirtual

Creates a copy of the node.

Caller takes ownership of the returned object.

Implements QgsEsriArcadeNode.

Definition at line 731 of file qgsesriarcadescript.cpp.

◆ collection()

QgsEsriArcadeExpression * QgsEsriArcadeForInStatement::collection ( ) const
inline

Returns the collection expression being iterated over.

Definition at line 1230 of file qgsesriarcadescript.h.

◆ dump()

QString QgsEsriArcadeForInStatement::dump ( ) const
overridevirtual

Returns the formatted script representation of the node.

This can be used to export a script node back to a valid Esri arcade script string.

Implements QgsEsriArcadeNode.

Definition at line 725 of file qgsesriarcadescript.cpp.

◆ isVariableDeclaration()

bool QgsEsriArcadeForInStatement::isVariableDeclaration ( ) const
inline

Returns true if the loop variable was declared with the var keyword.

Definition at line 1225 of file qgsesriarcadescript.h.

◆ iterationType()

IterationType QgsEsriArcadeForInStatement::iterationType ( ) const
inline

Returns the iteration type (for...in or for...of).

Definition at line 1215 of file qgsesriarcadescript.h.

◆ nodeType()

QgsEsriArcadeNode::NodeType QgsEsriArcadeForInStatement::nodeType ( ) const
inlineoverridevirtual

Returns the node type.

Implements QgsEsriArcadeNode.

Definition at line 1207 of file qgsesriarcadescript.h.

◆ variableName()

QString QgsEsriArcadeForInStatement::variableName ( ) const
inline

Returns the loop variable identifier name.

Definition at line 1220 of file qgsesriarcadescript.h.


The documentation for this class was generated from the following files: