String expression evaluator.  
#include <QtxEvalExpr.h>
 | 
| enum   | Error {  
  OK, 
OperandsNotMatch, 
InvalidResult, 
InvalidOperation, 
 
  OperationsNull, 
InvalidToken, 
CloseExpected, 
ExcessClose, 
 
  BracketsNotMatch, 
StackUnderflow, 
ExcessData
 
 } | 
|   | Parsing error type.  More...
  | 
|   | 
| Enumerator | 
|---|
| OK  | 
 No errors found.  
 | 
| OperandsNotMatch  | 
 Types of arguments are invalid for this operation.  
 | 
| InvalidResult  | 
 Operation cannot find result (for example, division by zero)  
 | 
| InvalidOperation  | 
 Unknown operation.  
 | 
| OperationsNull  | 
 Internal operations pointer of parser is null.  
 | 
| InvalidToken  | 
 Invalid token (neither operation, nor parameter of value)  
 | 
| CloseExpected  | 
 Closing bracket is expected.  
 | 
| ExcessClose  | 
 Extra closing bracket is found.  
 | 
| BracketsNotMatch  | 
 Opening and closing brackets are of different type, e.g. [)  
 | 
| StackUnderflow  | 
 There are no arguments in the stack for the operation.  
 | 
| ExcessData  | 
 The parsing is finished, but there are more then one value in the stack.  
 | 
 
 
      
        
          | QtxEvalExpr::QtxEvalExpr  | 
          ( | 
          const QString &  | 
          expr = QString() | ) | 
           | 
        
      
 
The evaluator is initalized by standard operations. Use another constructor with parameter stdSets = false to avoid initialization of evaluator with standard operations.
- Parameters
 - 
  
    | expr | expression to be evaluated  | 
  
   
References intialize().
 
 
      
        
          | QtxEvalExpr::QtxEvalExpr  | 
          ( | 
          const bool  | 
          stdSets,  | 
        
        
           | 
           | 
          const QString &  | 
          expr = QString()  | 
        
        
           | 
          ) | 
           |  | 
        
      
 
- Parameters
 - 
  
    | stdSets | if true, the evaluator is initalized by standard operations  | 
    | expr | expression to be evaluated  | 
  
   
References intialize().
 
 
      
        
          | QtxEvalExpr::~QtxEvalExpr  | 
          ( | 
           | ) | 
           | 
        
      
 
 
      
        
          | bool QtxEvalExpr::autoDeleteOperationSets  | 
          ( | 
           | ) | 
           const | 
        
      
 
 
      
        
          | QVariant QtxEvalExpr::calculate  | 
          ( | 
          const QString &  | 
          expr = QString() | ) | 
           | 
        
      
 
 
      
        
          | QString QtxEvalExpr::expression  | 
          ( | 
           | ) | 
           const | 
        
      
 
- Returns
 - expression string 
 
References myExpr.
 
 
      
        
          | void QtxEvalExpr::insertOperationSet  | 
          ( | 
          QtxEvalSet *  | 
          set,  | 
        
        
           | 
           | 
          const int  | 
          idx = -1  | 
        
        
           | 
          ) | 
           |  | 
        
      
 
 
  
  
      
        
          | void QtxEvalExpr::intialize  | 
          ( | 
          const bool  | 
          stdSets,  | 
         
        
           | 
           | 
          const QString &  | 
          expr  | 
         
        
           | 
          ) | 
           |  | 
         
       
   | 
  
private   | 
  
 
 
- Returns
 - expression parser 
 
References myParser.
 
 
      
        
          | void QtxEvalExpr::removeOperationSet  | 
          ( | 
          QtxEvalSet *  | 
          set | ) | 
           | 
        
      
 
 
      
        
          | void QtxEvalExpr::setAutoDeleteOperationSets  | 
          ( | 
          const bool  | 
          on | ) | 
           | 
        
      
 
 
      
        
          | void QtxEvalExpr::setExpression  | 
          ( | 
          const QString &  | 
          expr | ) | 
           | 
        
      
 
 
  
  
      
        
          | QString QtxEvalExpr::myExpr | 
         
       
   | 
  
private   | 
  
 
 
The documentation for this class was generated from the following files: