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

Represents a binary operation expression. More...

#include <qgsvbscript.h>

Inheritance diagram for QgsVbScriptBinaryOperatorExpression:

Public Types

enum class  BinaryOperator {
  Plus , Minus , Multiply , Divide ,
  IntegerDivide , Modulo , Exponent , Concat ,
  Equal , NotEqual , LessThan , GreaterThan ,
  LessThanOrEqual , GreaterThanOrEqual , Is , LogicalAnd ,
  LogicalOr , LogicalXor , LogicalImp , LogicalEqv
}
 Binary operator enumeration. More...
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...

Public Member Functions

 QgsVbScriptBinaryOperatorExpression (BinaryOperator binaryOperator, QgsVbScriptExpression *leftOperand, QgsVbScriptExpression *rightOperand)
 Constructor for QgsVbScriptBinaryOperatorExpression.
void accept (QgsVbScriptVisitor &visitor) const override
 Accepts a visitor to traverse the node.
BinaryOperator binaryOperator () const
 Returns the binary operator.
QgsVbScriptNode * clone () const override
 Creates a copy of the node.
QString dump () const override
 Returns the formatted script representation of the node.
bool leftAssociative () const
 Returns true if operator is left-associative.
QgsVbScriptExpression * leftOperand () const
 Returns the left-hand operand expression.
QgsVbScriptNode::NodeType nodeType () const override
 Returns the node type.
int precedence () const
 Returns operator precedence value.
QgsVbScriptExpression * rightOperand () const
 Returns the right-hand operand expression.
QString text () const
 Returns text representation of the operator.
Public Member Functions inherited from QgsVbScriptExpression
 ~QgsVbScriptExpression () override=default
Public Member Functions inherited from QgsVbScriptNode
virtual ~QgsVbScriptNode ()=default

Static Public Attributes

static const char * BINARY_OPERATOR_TEXT [] = { "+", "-", "*", "/", "\\", "Mod", "^", "&", "=", "<>", "<", ">", "<=", ">=", "Is", "And", "Or", "Xor", "Eqv", "Imp" }

Detailed Description

Represents a binary operation expression.

Since
QGIS 4.4

Definition at line 563 of file qgsvbscript.h.

Member Enumeration Documentation

◆ BinaryOperator

Binary operator enumeration.

Enumerator
Plus 

Addition +.

Minus 

Subtraction -.

Multiply 

Multiplication *.

Divide 

Division /.

IntegerDivide 

Integer division.

Modulo 

Modulo %.

Exponent 

Exponential ^.

Concat 

String concatenation &.

Equal 

Equality test ==.

NotEqual 

Not equal test !=.

LessThan 

Less than <.

GreaterThan 

Greater than >.

LessThanOrEqual 

Less than or equal to <=.

GreaterThanOrEqual 

Greater than or equal to >=.

Is 

Is comparison.

LogicalAnd 

Logical and.

LogicalOr 

Logical or.

LogicalXor 

Logical xor.

LogicalImp 

Logical imp.

LogicalEqv 

Logical eqv.

Definition at line 569 of file qgsvbscript.h.

Constructor & Destructor Documentation

◆ QgsVbScriptBinaryOperatorExpression()

QgsVbScriptBinaryOperatorExpression::QgsVbScriptBinaryOperatorExpression ( BinaryOperator binaryOperator,
QgsVbScriptExpression * leftOperand,
QgsVbScriptExpression * rightOperand )

Constructor for QgsVbScriptBinaryOperatorExpression.

Ownership of leftOperand and rightOperand is transferred to this expression.

Definition at line 289 of file qgsvbscript.cpp.

Member Function Documentation

◆ accept()

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

Accepts a visitor to traverse the node.

Implements QgsVbScriptNode.

Definition at line 364 of file qgsvbscript.cpp.

◆ binaryOperator()

BinaryOperator QgsVbScriptBinaryOperatorExpression::binaryOperator ( ) const
inline

Returns the binary operator.

Definition at line 611 of file qgsvbscript.h.

◆ clone()

QgsVbScriptNode * QgsVbScriptBinaryOperatorExpression::clone ( ) const
overridevirtual

Creates a copy of the node.

Caller takes ownership of the returned object.

Implements QgsVbScriptNode.

Definition at line 357 of file qgsvbscript.cpp.

◆ dump()

QString QgsVbScriptBinaryOperatorExpression::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 345 of file qgsvbscript.cpp.

◆ leftAssociative()

bool QgsVbScriptBinaryOperatorExpression::leftAssociative ( ) const

Returns true if operator is left-associative.

Definition at line 340 of file qgsvbscript.cpp.

◆ leftOperand()

QgsVbScriptExpression * QgsVbScriptBinaryOperatorExpression::leftOperand ( ) const
inline

Returns the left-hand operand expression.

Definition at line 616 of file qgsvbscript.h.

◆ nodeType()

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

Returns the node type.

Implements QgsVbScriptNode.

Definition at line 603 of file qgsvbscript.h.

◆ precedence()

int QgsVbScriptBinaryOperatorExpression::precedence ( ) const

Returns operator precedence value.

Definition at line 300 of file qgsvbscript.cpp.

◆ rightOperand()

QgsVbScriptExpression * QgsVbScriptBinaryOperatorExpression::rightOperand ( ) const
inline

Returns the right-hand operand expression.

Definition at line 621 of file qgsvbscript.h.

◆ text()

QString QgsVbScriptBinaryOperatorExpression::text ( ) const

Returns text representation of the operator.

Definition at line 295 of file qgsvbscript.cpp.

Member Data Documentation

◆ BINARY_OPERATOR_TEXT

const char * QgsVbScriptBinaryOperatorExpression::BINARY_OPERATOR_TEXT = { "+", "-", "*", "/", "\\", "Mod", "^", "&", "=", "<>", "<", ">", "<=", ">=", "Is", "And", "Or", "Xor", "Eqv", "Imp" }
static
Note
not available in Python bindings

Definition at line 31 of file qgsvbscript.h.


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