Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Nov 30, 2009, 11:32:53 PM (14 years ago)
Author:
rgrieder
Message:

Extended ExprParser to support arbitrary variables. You can set them with ExprParser::setVariable.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/presentation2/src/libraries/util/ExprParser.h

    r5738 r6185  
    3636
    3737#include "UtilPrereqs.h"
     38
     39#include <map>
    3840#include <string>
    3941
     
    7173
    7274
    73         ExprParser(const std::string& str);
     75        ExprParser();
     76        void parse(const std::string& str);
    7477        const std::string& getRemains() { return  this->remains_; }
    7578        double             getResult()  { return  this->result_; }
    7679        bool               getSuccess() { return !this->failed_; }
     80
     81        void setVariable(const std::string& varname, double value);
    7782
    7883    private:
     
    97102        double result_;
    98103        std::string remains_;
    99 
     104        std::map<std::string, double> variables_;
    100105    };
    101106
Note: See TracChangeset for help on using the changeset viewer.