Version: 9.12.0
QtxEvalSetString Class Reference

Provides set of string operations for the parser. More...

#include <QtxEvalExpr.h>

Inheritance diagram for QtxEvalSetString:
Inheritance graph

Public Member Functions

 QtxEvalSetString ()
 Constructor. More...
 
virtual ~QtxEvalSetString ()
 Destructor. More...
 
virtual bool createValue (const QString &, QVariant &) const
 Create value from its string representation. More...
 
virtual int priority (const QString &, bool isBin) const
 Get the operation priority. More...
 
virtual QtxEvalExpr::Error calculate (const QString &, QVariant &, QVariant &) const
 Calculate the operation. More...
 
virtual QString name () const
 Get operations set name. More...
 
- Public Member Functions inherited from QtxEvalSetBase
 QtxEvalSetBase ()
 Constructor. More...
 
virtual ~QtxEvalSetBase ()
 Destructor. More...
 
virtual void operationList (QStringList &) const
 Get the list of possible operations. More...
 
virtual void bracketsList (QStringList &, bool open) const
 Get list of brackets. More...
 
virtual QtxEvalExpr::Error isValid (const QString &, const QVariant::Type, const QVariant::Type) const
 Check operation validity. More...
 
- Public Member Functions inherited from QtxEvalSet
 QtxEvalSet ()
 Constructor. More...
 
virtual ~QtxEvalSet ()
 Destructor. More...
 

Static Public Member Functions

static QString Name ()
 Get operations set name. More...
 

Additional Inherited Members

- Protected Types inherited from QtxEvalSetBase
typedef QList< QVariant::Type > ListOfTypes
 
- Protected Member Functions inherited from QtxEvalSetBase
void addTypes (const ListOfTypes &)
 Add operand types. More...
 
void addOperations (const QStringList &)
 Add operation names to the internal list of operations. More...
 

Detailed Description

Provides set of string operations for the parser.

Constructor & Destructor Documentation

◆ QtxEvalSetString()

QtxEvalSetString::QtxEvalSetString ( )

◆ ~QtxEvalSetString()

QtxEvalSetString::~QtxEvalSetString ( )
virtual

Destructor.

Member Function Documentation

◆ calculate()

QtxEvalExpr::Error QtxEvalSetString::calculate ( const QString &  op,
QVariant &  v1,
QVariant &  v2 
) const
virtual

Calculate the operation.

Process binary operation with values v1 and v2. For unary operation the \v2 is invalid. The result of the operation is returned in the parameter v1.

Parameters
opoperation name
v1first argument (not valid for unary prefix operations)
v2second argument (not valid for unary postfix operations)
Returns
error code (QtxEvalExpr::Error)

Implements QtxEvalSet.

References QtxEvalExpr::OK.

◆ createValue()

bool QtxEvalSetString::createValue ( const QString &  str,
QVariant &  val 
) const
virtual

Create value from its string representation.

Creates string value from Qt string representation.

Parameters
strstring representration of the value
valreturning value
Returns
true if str can be evaluated as custom value and false otherwise (parameter)

Reimplemented from QtxEvalSet.

References QtxEvalSet::createValue().

◆ Name()

QString QtxEvalSetString::Name ( )
static

Get operations set name.

Returns
operations set name

◆ name()

QString QtxEvalSetString::name ( ) const
virtual

Get operations set name.

Returns
operations set name

Implements QtxEvalSet.

References Name().

◆ priority()

int QtxEvalSetString::priority ( const QString &  op,
bool  isBin 
) const
virtual

Get the operation priority.

Operation priority counts from 1. If the operation is impossible, this function returns value <= 0.

Parameters
opoperation
isBintrue 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: