Makes operator to use string_view

This commit is contained in:
Felipe Zimmerle
2019-03-05 12:26:44 -03:00
parent d5158f1afc
commit 301f724e9e
85 changed files with 1954 additions and 298 deletions

View File

@@ -71,7 +71,7 @@ namespace operators {
bool Operator::evaluateInternal(Transaction *transaction,
RuleWithActions *rule, const std::string& a, RuleMessage *rm) {
RuleWithActions *rule, const bpstd::string_view &a, RuleMessage *rm) {
bool res = evaluate(transaction, rule, a, rm);
if (m_negation) {
@@ -81,28 +81,6 @@ bool Operator::evaluateInternal(Transaction *transaction,
return res;
}
bool Operator::evaluateInternal(Transaction *transaction,
RuleWithActions *rule, const std::string& a) {
bool res = evaluate(transaction, rule, a);
if (m_negation) {
return !res;
}
return res;
}
bool Operator::evaluateInternal(Transaction *transaction,
const std::string& a) {
bool res = evaluate(transaction, a);
if (m_negation) {
return !res;
}
return res;
}
std::string Operator::resolveMatchMessage(Transaction *t,
std::string key, std::string value) {
@@ -132,7 +110,10 @@ std::string Operator::resolveMatchMessage(Transaction *t,
}
bool Operator::evaluate(Transaction *transaction, const std::string& a) {
bool Operator::evaluate(Transaction *transaction,
RuleWithActions *rule,
const bpstd::string_view &input,
RuleMessage *ruleMessage) {
ms_dbg_a(transaction, 2, "Operator: " + m_op + \
" is not implemented or malfunctioning.");
return true;