Provides set of arithmetical operations for the parser.
#include <QtxEvalExpr.h>
|
static QString | Name () |
| Get operations set name. More...
|
|
QtxEvalSetArithmetic::QtxEvalSetArithmetic |
( |
| ) |
|
QtxEvalSetArithmetic::~QtxEvalSetArithmetic |
( |
| ) |
|
|
virtual |
Process binary operation with values v1 and v2. For unary operation the is invalid. The result of the operation is returned in the parameter v1.
- Parameters
-
op | operation name |
v1 | first argument (not valid for unary prefix operations) |
v2 | second argument (not valid for unary postfix operations) |
- Returns
- error code (QtxEvalExpr::Error)
Implements QtxEvalSet.
References QtxEvalExpr::InvalidResult, and QtxEvalExpr::OK.
bool QtxEvalSetArithmetic::createValue |
( |
const QString & |
str, |
|
|
QVariant & |
val |
|
) |
| const |
|
virtual |
Creates numbers from string representation.
- Parameters
-
str | string representration of the value |
val | returning value |
- Returns
true
if str can be evaluated as custom value and false
otherwise (parameter)
Reimplemented from QtxEvalSet.
References QtxEvalSet::createValue().
QString QtxEvalSetArithmetic::Name |
( |
| ) |
|
|
static |
- Returns
- operations set name
QString QtxEvalSetArithmetic::name |
( |
| ) |
const |
|
virtual |
int QtxEvalSetArithmetic::priority |
( |
const QString & |
op, |
|
|
bool |
isBin |
|
) |
| const |
|
virtual |
Operation priority counts from 1. If the operation is impossible, this function returns value <= 0.
- Parameters
-
op | operation |
isBin | true if the operation is binary and false if it is unary |
- Returns
- operation priority
Implements QtxEvalSet.
The documentation for this class was generated from the following files: