From f41f9e1f0d9c76e1fd9205f1ca73307e620ea882 Mon Sep 17 00:00:00 2001 From: Felipe Zimmerle Date: Mon, 27 Jul 2015 15:56:38 -0300 Subject: [PATCH] Adds "negation" property to the operators signature --- src/operators/operator.cc | 9 --------- src/operators/operator.h | 9 +++++++-- 2 files changed, 7 insertions(+), 11 deletions(-) diff --git a/src/operators/operator.cc b/src/operators/operator.cc index c41f0c08..c238a935 100644 --- a/src/operators/operator.cc +++ b/src/operators/operator.cc @@ -64,9 +64,6 @@ namespace ModSecurity { namespace operators { -Operator::Operator() { -} - bool Operator::debug(Assay *assay, int x, std::string a) { assay->debug(x, a); @@ -74,12 +71,6 @@ bool Operator::debug(Assay *assay, int x, std::string a) { } -Operator::Operator(std::string op, std::string param, bool negation) { - this->op = op; - this->param = param; -} - - bool Operator::evaluate(Assay *assay) { if (assay) { assay->debug(2, "Operator: " + this->op + \ diff --git a/src/operators/operator.h b/src/operators/operator.h index b2d5874c..822aa161 100644 --- a/src/operators/operator.h +++ b/src/operators/operator.h @@ -29,11 +29,16 @@ namespace operators { class Operator { public: /** @ingroup ModSecurity_Operator */ - Operator(); - Operator(std::string po, std::string param, bool invert); + Operator() { } + Operator(std::string op, std::string param, bool negation) + : op(op), + param(param), + negation(negation) { } + std::string op; std::string param; + bool negation; virtual bool evaluate(Assay *assay); virtual bool evaluate(Assay *assay, const std::string &str);