Refactoring on the operators: negation is now being handled globally

Other minors changes were also made, including adding the prefix `m_'
to all the members of the class.
This commit is contained in:
Felipe Zimmerle
2016-10-19 10:23:03 -03:00
parent 28a44b966a
commit 8757840bc3
36 changed files with 88 additions and 138 deletions

View File

@@ -30,27 +30,30 @@ class Operator {
public:
/** @ingroup ModSecurity_Operator */
Operator()
: op(""),
param(""),
negation(false) { }
: m_match_message(""),
m_negation(false),
m_op(""),
m_param("") { }
Operator(std::string op, std::string param, bool negation)
: op(op),
param(param),
negation(negation) { }
: m_match_message(""),
m_negation(negation),
m_op(op),
m_param(param) { }
virtual ~Operator() { }
std::string op;
std::string param;
bool negation;
static Operator *instantiate(std::string opName);
virtual bool init(const std::string &file, std::string *error) {
virtual bool init(const std::string &arg, std::string *error) {
return true;
}
bool evaluateInternal(Transaction *t, const std::string& a);
virtual bool evaluate(Transaction *transaction, const std::string &str);
static Operator *instantiate(std::string op);
bool m_negation;
std::string m_match_message;
std::string m_op;
std::string m_param;
protected:
bool debug(Transaction *transaction, int x, std::string a);