class BooleanEvaluator
{
public:
- using Function = std::function<bool(const std::string &, const std::string *)>;
+ using ValueFunction = std::function<bool(const std::string &)>;
+ using CompareFunction = std::function<bool(const std::string &, const std::string *)>;
private:
- Function func;
+ CompareFunction func;
std::string ops;
std::vector<std::string> var_stack;
std::vector<unsigned char> value_stack;
bool last_was_op;
public:
- BooleanEvaluator(const Function &, bool = true);
+ BooleanEvaluator(const ValueFunction &);
+ BooleanEvaluator(const CompareFunction &);
bool evaluate(const std::string &);
private: