Refactoring in the Rule class to make it more elegant

This commit is contained in:
Felipe Zimmerle
2019-02-25 20:22:38 -03:00
parent 4669387d1f
commit 9c0d5d104d
26 changed files with 199 additions and 219 deletions

View File

@@ -35,6 +35,9 @@ class Block : public Action {
public:
explicit Block(const std::string &action) : Action(action) { }
Block(const Block &a) = delete;
Block &operator=(const Block &a) = delete;
bool evaluate(RuleWithActions *rule, Transaction *transaction,
RuleMessage &rm) override;
};

View File

@@ -49,7 +49,7 @@ bool RuleId::init(std::string *error) {
bool RuleId::evaluate(RuleWithActions *rule, Transaction *transaction) {
rule->m_ruleId = m_ruleId;
rule->setId(m_ruleId);
return true;
}

View File

@@ -35,7 +35,7 @@ class EscapeSeqDecode : public Transformation {
std::string evaluate(const std::string &exp,
Transaction *transaction) override;
int ansi_c_sequences_decode_inplace(unsigned char *input, int input_len);
static int ansi_c_sequences_decode_inplace(unsigned char *input, int input_len);
};
} // namespace transformations

View File

@@ -36,7 +36,7 @@ class UrlEncode : public Transformation {
std::string evaluate(const std::string &exp,
Transaction *transaction) override;
std::string url_enc(const char *input,
static std::string url_enc(const char *input,
unsigned int input_len, int *changed);
};