QGIS API Documentation 4.3.0-Master (0cef2469b72)
Loading...
Searching...
No Matches
QgsVbScriptIfStatement Class Reference

Represents an if statement. More...

#include <qgsvbscript.h>

Inheritance diagram for QgsVbScriptIfStatement:

Public Member Functions

 QgsVbScriptIfStatement (QgsVbScriptExpression *condition, QgsVbScriptBlockStatement *trueBlock, QgsVbScriptBlockStatement *falseBlock=nullptr, bool isInline=false)
 Constructor for QgsVbScriptIfStatement.
void accept (QgsVbScriptVisitor &visitor) const override
 Accepts a visitor to traverse the node.
QgsVbScriptNode * clone () const override
 Creates a copy of the node.
QgsVbScriptExpression * condition () const
 Returns the condition expression.
QString dump () const override
 Returns the formatted script representation of the node.
QgsVbScriptBlockStatement * falseBlock () const
 Returns the statement block executed when the condition evaluates to false, or nullptr if none.
bool isInline () const
 Returns true if this statement was declared as a single-line inline If.
QgsVbScriptNode::NodeType nodeType () const override
 Returns the node type.
QgsVbScriptBlockStatement * trueBlock () const
 Returns the statement block executed when the condition evaluates to true.
Public Member Functions inherited from QgsVbScriptStatement
 ~QgsVbScriptStatement () override=default
Public Member Functions inherited from QgsVbScriptNode
virtual ~QgsVbScriptNode ()=default

Additional Inherited Members

Public Types inherited from QgsVbScriptNode
enum class  NodeType {
  BlockStatement , VariableDeclarationStatement , AssignmentStatement , FunctionDeclarationStatement ,
  ExpressionStatement , LiteralExpression , VariableReferenceExpression , MemberAccessExpression ,
  BinaryOperatorExpression , UnaryOperatorExpression , FunctionCallExpression , IndexExpression ,
  ArrayLiteralExpression , IfStatement , ForStatement , ForEachStatement ,
  WhileStatement , ExitStatement , FieldReferenceExpression
}
 Node type identifier. More...

Detailed Description

Represents an if statement.

Since
QGIS 4.4

Definition at line 851 of file qgsvbscript.h.

Constructor & Destructor Documentation

◆ QgsVbScriptIfStatement()

QgsVbScriptIfStatement::QgsVbScriptIfStatement ( QgsVbScriptExpression * condition,
QgsVbScriptBlockStatement * trueBlock,
QgsVbScriptBlockStatement * falseBlock = nullptr,
bool isInline = false )

Constructor for QgsVbScriptIfStatement.

Ownership of condition, trueBlock, and falseBlock is transferred to this statement.

Definition at line 513 of file qgsvbscript.cpp.

Member Function Documentation

◆ accept()

void QgsVbScriptIfStatement::accept ( QgsVbScriptVisitor & visitor) const
overridevirtual

Accepts a visitor to traverse the node.

Implements QgsVbScriptNode.

Definition at line 556 of file qgsvbscript.cpp.

◆ clone()

QgsVbScriptNode * QgsVbScriptIfStatement::clone ( ) const
overridevirtual

Creates a copy of the node.

Caller takes ownership of the returned object.

Implements QgsVbScriptNode.

Definition at line 548 of file qgsvbscript.cpp.

◆ condition()

QgsVbScriptExpression * QgsVbScriptIfStatement::condition ( ) const
inline

Returns the condition expression.

Definition at line 871 of file qgsvbscript.h.

◆ dump()

QString QgsVbScriptIfStatement::dump ( ) const
overridevirtual

Returns the formatted script representation of the node.

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

Implements QgsVbScriptNode.

Definition at line 520 of file qgsvbscript.cpp.

◆ falseBlock()

QgsVbScriptBlockStatement * QgsVbScriptIfStatement::falseBlock ( ) const
inline

Returns the statement block executed when the condition evaluates to false, or nullptr if none.

Definition at line 881 of file qgsvbscript.h.

◆ isInline()

bool QgsVbScriptIfStatement::isInline ( ) const
inline

Returns true if this statement was declared as a single-line inline If.

Definition at line 886 of file qgsvbscript.h.

◆ nodeType()

QgsVbScriptNode::NodeType QgsVbScriptIfStatement::nodeType ( ) const
inlineoverridevirtual

Returns the node type.

Implements QgsVbScriptNode.

Definition at line 863 of file qgsvbscript.h.

◆ trueBlock()

QgsVbScriptBlockStatement * QgsVbScriptIfStatement::trueBlock ( ) const
inline

Returns the statement block executed when the condition evaluates to true.

Definition at line 876 of file qgsvbscript.h.


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