Provides set of string operations for the parser.
#include <QtxEvalExpr.h>
Public Member Functions |
| | QtxEvalSetString () |
| | Constructor.
|
| virtual | ~QtxEvalSetString () |
| | Destructor.
|
| virtual bool | createValue (const QString &, QVariant &) const |
| | Create value from its string representation.
|
| virtual int | priority (const QString &, bool isBin) const |
| | Get the operation priority.
|
| virtual QtxEvalExpr::Error | calculate (const QString &, QVariant &, QVariant &) const |
| | Calculate the operation.
|
| virtual QString | name () const |
| | Get operations set name.
|
| virtual void | operationList (QStringList &) const |
| | Get the list of possible operations.
|
| virtual void | bracketsList (QStringList &, bool open) const |
| | Get list of brackets.
|
| virtual QtxEvalExpr::Error | isValid (const QString &, const QVariant::Type, const QVariant::Type) const |
| | Check operation validity.
|
Static Public Member Functions |
| static QString | Name () |
| | Get operations set name.
|
Protected Types |
| typedef QList< QVariant::Type > | ListOfTypes |
Protected Member Functions |
| void | addTypes (const ListOfTypes &) |
| | Add operand types.
|
| void | addOperations (const QStringList &) |
| | Add operation names to the internal list of operations.
|
Member Typedef Documentation
Constructor & Destructor Documentation
| QtxEvalSetString::QtxEvalSetString |
( |
| ) |
|
| QtxEvalSetString::~QtxEvalSetString |
( |
| ) |
[virtual] |
Member Function Documentation
| bool QtxEvalSetString::createValue |
( |
const QString & |
str, |
|
|
QVariant & |
val |
|
) |
| const [virtual] |
Creates string value from Qt 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.
| int QtxEvalSetString::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.
| QtxEvalExpr::Error QtxEvalSetString::calculate |
( |
const QString & |
op, |
|
|
QVariant & |
v1, |
|
|
QVariant & |
v2 |
|
) |
| const [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.OK.
| QString QtxEvalSetString::Name |
( |
| ) |
[static] |
- Returns:
- operations set name
| QString QtxEvalSetString::name |
( |
| ) |
const [virtual] |
| void QtxEvalSetBase::operationList |
( |
QStringList & |
list | ) |
const [virtual, inherited] |
| void QtxEvalSetBase::bracketsList |
( |
QStringList & |
list, |
|
|
bool |
open |
|
) |
| const [virtual, inherited] |
- Parameters:
-
| list | returning list of brackets |
| open | if true, collect opening brackets, or closing brackets otherwise |
Implements QtxEvalSet.
Reimplemented in QtxEvalSetSets.
| QtxEvalExpr::Error QtxEvalSetBase::isValid |
( |
const QString & |
op, |
|
|
const QVariant::Type |
t1, |
|
|
const QVariant::Type |
t2 |
|
) |
| const [virtual, inherited] |
| void QtxEvalSetBase::addTypes |
( |
const ListOfTypes & |
list | ) |
[protected, inherited] |
| void QtxEvalSetBase::addOperations |
( |
const QStringList & |
list | ) |
[protected, inherited] |