| 138 | } |
| 139 | |
| 140 | inline int |
| 141 | Expression::_findOperator(const char *expr, int expr_len, Operator &op) const |
| 142 | { |
| 143 | string expr_str(expr, expr_len); |
| 144 | size_t sep; |
| 145 | for (int i = 0; i < N_OPERATORS; ++i) { |
| 146 | const OperatorString &op_str = OPERATOR_STRINGS[i]; |
| 147 | sep = (op_str.str_len == 1) ? expr_str.find(op_str.str[0]) : expr_str.find(op_str.str); |
| 148 | if (sep < expr_str.size()) { |
| 149 | op = static_cast<Operator>(i); |
| 150 | return static_cast<int>(sep); |
| 151 | } |
| 152 | } |
| 153 | return -1; |
| 154 | } |
| 155 | |
| 156 | inline bool |
| 157 | Expression::_evalSimpleExpr(const char *expr, int expr_len) |