From ec9a97324fb1ad63df7cc9fbede41a8bbfa7edeb Mon Sep 17 00:00:00 2001 From: Felipe Zimmerle Date: Fri, 24 Jul 2015 18:47:47 -0300 Subject: [PATCH] Fix actions: returning string copy after evaluation --- src/actions/action.cc | 2 +- src/actions/action.h | 2 +- src/actions/transformations/base64_decode.cc | 3 ++- src/actions/transformations/base64_decode.h | 2 +- src/actions/transformations/base64_decode_ext.cc | 3 ++- src/actions/transformations/base64_decode_ext.h | 2 +- src/actions/transformations/cmd_line.cc | 3 ++- src/actions/transformations/cmd_line.h | 2 +- src/actions/transformations/compress_whitespace.cc | 3 ++- src/actions/transformations/compress_whitespace.h | 2 +- src/actions/transformations/css_decode.cc | 3 ++- src/actions/transformations/css_decode.h | 2 +- src/actions/transformations/escape_seq_decode.cc | 2 +- src/actions/transformations/escape_seq_decode.h | 2 +- src/actions/transformations/hex_decode.cc | 3 ++- src/actions/transformations/hex_decode.h | 2 +- src/actions/transformations/hex_encode.cc | 2 +- src/actions/transformations/hex_encode.h | 2 +- src/actions/transformations/html_entity_decode.cc | 2 +- src/actions/transformations/html_entity_decode.h | 2 +- src/actions/transformations/js_decode.cc | 3 ++- src/actions/transformations/js_decode.h | 2 +- src/actions/transformations/length.cc | 3 ++- src/actions/transformations/length.h | 2 +- src/actions/transformations/lowercase.cc | 2 +- src/actions/transformations/lowercase.h | 2 +- src/actions/transformations/md5.cc | 2 +- src/actions/transformations/md5.h | 3 ++- src/actions/transformations/none.cc | 3 ++- src/actions/transformations/none.h | 2 +- src/actions/transformations/normalise_path.cc | 2 +- src/actions/transformations/normalise_path.h | 2 +- src/actions/transformations/normalise_path_win.cc | 2 +- src/actions/transformations/normalise_path_win.h | 2 +- src/actions/transformations/parity_even_7bit.cc | 2 +- src/actions/transformations/parity_even_7bit.h | 2 +- src/actions/transformations/parity_odd_7bit.cc | 2 +- src/actions/transformations/parity_odd_7bit.h | 2 +- src/actions/transformations/parity_zero_7bit.cc | 2 +- src/actions/transformations/parity_zero_7bit.h | 2 +- src/actions/transformations/remove_comments.cc | 2 +- src/actions/transformations/remove_comments.h | 2 +- src/actions/transformations/remove_comments_char.cc | 2 +- src/actions/transformations/remove_comments_char.h | 2 +- src/actions/transformations/remove_nulls.cc | 2 +- src/actions/transformations/remove_nulls.h | 2 +- src/actions/transformations/remove_whitespace.cc | 2 +- src/actions/transformations/remove_whitespace.h | 2 +- src/actions/transformations/replace_comments.cc | 2 +- src/actions/transformations/replace_comments.h | 2 +- src/actions/transformations/replace_nulls.cc | 2 +- src/actions/transformations/replace_nulls.h | 2 +- src/actions/transformations/sha1.cc | 2 +- src/actions/transformations/sha1.h | 2 +- src/actions/transformations/sql_hex_decode.cc | 3 ++- src/actions/transformations/sql_hex_decode.h | 3 ++- src/actions/transformations/transformation.cc | 2 +- src/actions/transformations/transformation.h | 2 +- src/actions/transformations/trim.cc | 3 ++- src/actions/transformations/trim.h | 2 +- src/actions/transformations/trim_left.cc | 2 +- src/actions/transformations/trim_left.h | 2 +- src/actions/transformations/trim_right.cc | 2 +- src/actions/transformations/trim_right.h | 2 +- src/actions/transformations/url_decode.cc | 2 +- src/actions/transformations/url_decode.h | 2 +- src/actions/transformations/url_decode_uni.cc | 2 +- src/actions/transformations/url_decode_uni.h | 2 +- src/actions/transformations/url_encode.cc | 2 +- src/actions/transformations/url_encode.h | 2 +- src/actions/transformations/utf8_to_unicode.cc | 2 +- src/actions/transformations/utf8_to_unicode.h | 2 +- 72 files changed, 85 insertions(+), 72 deletions(-) diff --git a/src/actions/action.cc b/src/actions/action.cc index 1b95a552..31af4919 100644 --- a/src/actions/action.cc +++ b/src/actions/action.cc @@ -36,7 +36,7 @@ namespace ModSecurity { namespace actions { -std::string & Action::evaluate(std::string value, +std::string Action::evaluate(std::string value, Assay *assay) { return value; } diff --git a/src/actions/action.h b/src/actions/action.h index e170fcf0..13fcb4ff 100644 --- a/src/actions/action.h +++ b/src/actions/action.h @@ -74,7 +74,7 @@ class Action { int action_kind; std::string name; - virtual std::string& evaluate(std::string exp, + virtual std::string evaluate(std::string exp, Assay *assay); virtual bool evaluate(Assay *assay); virtual bool evaluate(Rule *rule); diff --git a/src/actions/transformations/base64_decode.cc b/src/actions/transformations/base64_decode.cc index 37a7a7af..0f1d59b1 100644 --- a/src/actions/transformations/base64_decode.cc +++ b/src/actions/transformations/base64_decode.cc @@ -35,12 +35,13 @@ Base64Decode::Base64Decode(std::string action) this->action_kind = 1; } -std::string& Base64Decode::evaluate(std::string value, +std::string Base64Decode::evaluate(std::string value, Assay *assay) { /** * @todo Implement the transformation base64decode */ assay->debug(4, "Transformation 64 is not implemented yet."); + return value; } } // namespace transformations diff --git a/src/actions/transformations/base64_decode.h b/src/actions/transformations/base64_decode.h index 18e64431..417a3776 100644 --- a/src/actions/transformations/base64_decode.h +++ b/src/actions/transformations/base64_decode.h @@ -31,7 +31,7 @@ namespace transformations { class Base64Decode : public Transformation { public: explicit Base64Decode(std::string action); - std::string& evaluate(std::string exp, + std::string evaluate(std::string exp, Assay *assay) override; }; diff --git a/src/actions/transformations/base64_decode_ext.cc b/src/actions/transformations/base64_decode_ext.cc index 62b15f3c..97b4bde2 100644 --- a/src/actions/transformations/base64_decode_ext.cc +++ b/src/actions/transformations/base64_decode_ext.cc @@ -35,12 +35,13 @@ Base64DecodeExt::Base64DecodeExt(std::string action) this->action_kind = 1; } -std::string& Base64DecodeExt::evaluate(std::string value, +std::string Base64DecodeExt::evaluate(std::string value, Assay *assay) { /** * @todo Implement the transformation Base64DecodeExt */ assay->debug(4, "Transformation Base64DecodeExt is not implemented yet."); + return value; } } // namespace transformations diff --git a/src/actions/transformations/base64_decode_ext.h b/src/actions/transformations/base64_decode_ext.h index e8d364b6..b65927da 100644 --- a/src/actions/transformations/base64_decode_ext.h +++ b/src/actions/transformations/base64_decode_ext.h @@ -31,7 +31,7 @@ namespace transformations { class Base64DecodeExt : public Transformation { public: explicit Base64DecodeExt(std::string action); - std::string& evaluate(std::string exp, + std::string evaluate(std::string exp, Assay *assay) override; }; diff --git a/src/actions/transformations/cmd_line.cc b/src/actions/transformations/cmd_line.cc index c7c52e5a..0deec1a2 100644 --- a/src/actions/transformations/cmd_line.cc +++ b/src/actions/transformations/cmd_line.cc @@ -35,12 +35,13 @@ CmdLine::CmdLine(std::string action) this->action_kind = 1; } -std::string& CmdLine::evaluate(std::string value, +std::string CmdLine::evaluate(std::string value, Assay *assay) { /** * @todo Implement the transformation CmdLine */ assay->debug(4, "Transformation CmdLine is not implemented yet."); + return value; } } // namespace transformations diff --git a/src/actions/transformations/cmd_line.h b/src/actions/transformations/cmd_line.h index 838928c7..dd45135c 100644 --- a/src/actions/transformations/cmd_line.h +++ b/src/actions/transformations/cmd_line.h @@ -31,7 +31,7 @@ namespace transformations { class CmdLine : public Transformation { public: explicit CmdLine(std::string action); - std::string& evaluate(std::string exp, + std::string evaluate(std::string exp, Assay *assay) override; }; diff --git a/src/actions/transformations/compress_whitespace.cc b/src/actions/transformations/compress_whitespace.cc index ebcd10a8..f9f976f1 100644 --- a/src/actions/transformations/compress_whitespace.cc +++ b/src/actions/transformations/compress_whitespace.cc @@ -35,13 +35,14 @@ CompressWhitespace::CompressWhitespace(std::string action) this->action_kind = 1; } -std::string& CompressWhitespace::evaluate(std::string value, +std::string CompressWhitespace::evaluate(std::string value, Assay *assay) { /** * @todo Implement the transformation CompressWhitespace */ assay->debug(4, "Transformation CompressWhitespace is " \ "not implemented yet."); + return value; } } // namespace transformations diff --git a/src/actions/transformations/compress_whitespace.h b/src/actions/transformations/compress_whitespace.h index 0b383b82..3c9164c3 100644 --- a/src/actions/transformations/compress_whitespace.h +++ b/src/actions/transformations/compress_whitespace.h @@ -31,7 +31,7 @@ namespace transformations { class CompressWhitespace : public Transformation { public: explicit CompressWhitespace(std::string action); - std::string& evaluate(std::string exp, + std::string evaluate(std::string exp, Assay *assay) override; }; diff --git a/src/actions/transformations/css_decode.cc b/src/actions/transformations/css_decode.cc index c30b0a4a..20189e81 100644 --- a/src/actions/transformations/css_decode.cc +++ b/src/actions/transformations/css_decode.cc @@ -35,12 +35,13 @@ CssDecode::CssDecode(std::string action) this->action_kind = 1; } -std::string& CssDecode::evaluate(std::string value, +std::string CssDecode::evaluate(std::string value, Assay *assay) { /** * @todo Implement the transformation CssDecode */ assay->debug(4, "Transformation CssDecode is not implemented yet."); + return value; } } // namespace transformations diff --git a/src/actions/transformations/css_decode.h b/src/actions/transformations/css_decode.h index 6325f8d0..3e3a30ed 100644 --- a/src/actions/transformations/css_decode.h +++ b/src/actions/transformations/css_decode.h @@ -31,7 +31,7 @@ namespace transformations { class CssDecode : public Transformation { public: explicit CssDecode(std::string action); - std::string& evaluate(std::string exp, + std::string evaluate(std::string exp, Assay *assay) override; }; diff --git a/src/actions/transformations/escape_seq_decode.cc b/src/actions/transformations/escape_seq_decode.cc index b01a7e4f..588dd70b 100644 --- a/src/actions/transformations/escape_seq_decode.cc +++ b/src/actions/transformations/escape_seq_decode.cc @@ -35,7 +35,7 @@ EscapeSeqDecode::EscapeSeqDecode(std::string action) this->action_kind = 1; } -std::string& EscapeSeqDecode::evaluate(std::string value, +std::string EscapeSeqDecode::evaluate(std::string value, Assay *assay) { /** * @todo Implement the transformation EscapeSeqDecode diff --git a/src/actions/transformations/escape_seq_decode.h b/src/actions/transformations/escape_seq_decode.h index 15e0c3f3..495b60a4 100644 --- a/src/actions/transformations/escape_seq_decode.h +++ b/src/actions/transformations/escape_seq_decode.h @@ -31,7 +31,7 @@ namespace transformations { class EscapeSeqDecode : public Transformation { public: explicit EscapeSeqDecode(std::string action); - std::string& evaluate(std::string exp, + std::string evaluate(std::string exp, Assay *assay) override; }; diff --git a/src/actions/transformations/hex_decode.cc b/src/actions/transformations/hex_decode.cc index ded4d2de..8c76ce03 100644 --- a/src/actions/transformations/hex_decode.cc +++ b/src/actions/transformations/hex_decode.cc @@ -35,12 +35,13 @@ HexDecode::HexDecode(std::string action) this->action_kind = 1; } -std::string& HexDecode::evaluate(std::string value, +std::string HexDecode::evaluate(std::string value, Assay *assay) { /** * @todo Implement the transformation HexDecode */ assay->debug(4, "Transformation HexDecode is not implemented yet."); + return value; } } // namespace transformations diff --git a/src/actions/transformations/hex_decode.h b/src/actions/transformations/hex_decode.h index 0fda1bc5..b6ac53ea 100644 --- a/src/actions/transformations/hex_decode.h +++ b/src/actions/transformations/hex_decode.h @@ -31,7 +31,7 @@ namespace transformations { class HexDecode : public Transformation { public: explicit HexDecode(std::string action); - std::string& evaluate(std::string exp, + std::string evaluate(std::string exp, Assay *assay) override; }; diff --git a/src/actions/transformations/hex_encode.cc b/src/actions/transformations/hex_encode.cc index 15f4eda2..3ef3a61f 100644 --- a/src/actions/transformations/hex_encode.cc +++ b/src/actions/transformations/hex_encode.cc @@ -35,7 +35,7 @@ HexEncode::HexEncode(std::string action) this->action_kind = 1; } -std::string& HexEncode::evaluate(std::string value, +std::string HexEncode::evaluate(std::string value, Assay *assay) { /** * @todo Implement the transformation HexEncode diff --git a/src/actions/transformations/hex_encode.h b/src/actions/transformations/hex_encode.h index f64da2f5..6a8daefa 100644 --- a/src/actions/transformations/hex_encode.h +++ b/src/actions/transformations/hex_encode.h @@ -31,7 +31,7 @@ namespace transformations { class HexEncode : public Transformation { public: explicit HexEncode(std::string action); - std::string& evaluate(std::string exp, + std::string evaluate(std::string exp, Assay *assay) override; }; diff --git a/src/actions/transformations/html_entity_decode.cc b/src/actions/transformations/html_entity_decode.cc index 4e3eb668..9455b936 100644 --- a/src/actions/transformations/html_entity_decode.cc +++ b/src/actions/transformations/html_entity_decode.cc @@ -35,7 +35,7 @@ HtmlEntityDecode::HtmlEntityDecode(std::string action) this->action_kind = 1; } -std::string& HtmlEntityDecode::evaluate(std::string value, +std::string HtmlEntityDecode::evaluate(std::string value, Assay *assay) { /** * @todo Implement the transformation HtmlEntityDecode diff --git a/src/actions/transformations/html_entity_decode.h b/src/actions/transformations/html_entity_decode.h index 71a61570..0490d02f 100644 --- a/src/actions/transformations/html_entity_decode.h +++ b/src/actions/transformations/html_entity_decode.h @@ -31,7 +31,7 @@ namespace transformations { class HtmlEntityDecode : public Transformation { public: explicit HtmlEntityDecode(std::string action); - std::string& evaluate(std::string exp, + std::string evaluate(std::string exp, Assay *assay) override; }; diff --git a/src/actions/transformations/js_decode.cc b/src/actions/transformations/js_decode.cc index 164dd327..d451cdec 100644 --- a/src/actions/transformations/js_decode.cc +++ b/src/actions/transformations/js_decode.cc @@ -35,12 +35,13 @@ JsDecode::JsDecode(std::string action) this->action_kind = 1; } -std::string& JsDecode::evaluate(std::string value, +std::string JsDecode::evaluate(std::string value, Assay *assay) { /** * @todo Implement the transformation JsDecode */ assay->debug(4, "Transformation JsDecode is not implemented yet."); + return value; } } // namespace transformations diff --git a/src/actions/transformations/js_decode.h b/src/actions/transformations/js_decode.h index 349fd82f..50423d9c 100644 --- a/src/actions/transformations/js_decode.h +++ b/src/actions/transformations/js_decode.h @@ -31,7 +31,7 @@ namespace transformations { class JsDecode : public Transformation { public: explicit JsDecode(std::string action); - std::string& evaluate(std::string exp, + std::string evaluate(std::string exp, Assay *assay) override; }; diff --git a/src/actions/transformations/length.cc b/src/actions/transformations/length.cc index 3d0e2c9e..d01a3ded 100644 --- a/src/actions/transformations/length.cc +++ b/src/actions/transformations/length.cc @@ -35,12 +35,13 @@ Length::Length(std::string action) this->action_kind = 1; } -std::string& Length::evaluate(std::string value, +std::string Length::evaluate(std::string value, Assay *assay) { /** * @todo Implement the transformation Length */ assay->debug(4, "Transformation Length is not implemented yet."); + return value; } } // namespace transformations diff --git a/src/actions/transformations/length.h b/src/actions/transformations/length.h index 9ced5ae5..862032ce 100644 --- a/src/actions/transformations/length.h +++ b/src/actions/transformations/length.h @@ -31,7 +31,7 @@ namespace transformations { class Length : public Transformation { public: explicit Length(std::string action); - std::string& evaluate(std::string exp, + std::string evaluate(std::string exp, Assay *assay) override; }; diff --git a/src/actions/transformations/lowercase.cc b/src/actions/transformations/lowercase.cc index 24516edb..35a453b8 100644 --- a/src/actions/transformations/lowercase.cc +++ b/src/actions/transformations/lowercase.cc @@ -31,7 +31,7 @@ LowerCase::LowerCase(std::string a) : Transformation(a) { } -std::string & LowerCase::evaluate(std::string value, +std::string LowerCase::evaluate(std::string value, Assay *assay) { std::locale loc; diff --git a/src/actions/transformations/lowercase.h b/src/actions/transformations/lowercase.h index b14aa487..10da9d78 100644 --- a/src/actions/transformations/lowercase.h +++ b/src/actions/transformations/lowercase.h @@ -32,7 +32,7 @@ namespace transformations { class LowerCase : public Transformation { public: explicit LowerCase(std::string action); - std::string& evaluate(std::string exp, + std::string evaluate(std::string exp, Assay *assay) override; }; diff --git a/src/actions/transformations/md5.cc b/src/actions/transformations/md5.cc index 9ccbffe3..a2b022b3 100644 --- a/src/actions/transformations/md5.cc +++ b/src/actions/transformations/md5.cc @@ -35,7 +35,7 @@ Md5::Md5(std::string action) this->action_kind = 1; } -std::string& Md5::evaluate(std::string value, +std::string Md5::evaluate(std::string value, Assay *assay) { /** * @todo Implement the transformation Md5 diff --git a/src/actions/transformations/md5.h b/src/actions/transformations/md5.h index 5ea09fa2..da0976fc 100644 --- a/src/actions/transformations/md5.h +++ b/src/actions/transformations/md5.h @@ -31,7 +31,8 @@ namespace transformations { class Md5 : public Transformation { public: explicit Md5(std::string action); - std::string& evaluate(std::string exp, + std::string + evaluate(std::string exp, Assay *assay) override; }; diff --git a/src/actions/transformations/none.cc b/src/actions/transformations/none.cc index 123678ef..bc945157 100644 --- a/src/actions/transformations/none.cc +++ b/src/actions/transformations/none.cc @@ -35,12 +35,13 @@ None::None(std::string action) this->action_kind = 1; } -std::string& None::evaluate(std::string value, +std::string None::evaluate(std::string value, Assay *assay) { /** * @todo Implement the transformation None */ assay->debug(4, "Transformation None is not implemented yet."); + return value; } } // namespace transformations diff --git a/src/actions/transformations/none.h b/src/actions/transformations/none.h index 7dd62568..6c74c762 100644 --- a/src/actions/transformations/none.h +++ b/src/actions/transformations/none.h @@ -31,7 +31,7 @@ namespace transformations { class None : public Transformation { public: explicit None(std::string action); - std::string& evaluate(std::string exp, + std::string evaluate(std::string exp, Assay *assay) override; }; diff --git a/src/actions/transformations/normalise_path.cc b/src/actions/transformations/normalise_path.cc index 5438da70..430eafb9 100644 --- a/src/actions/transformations/normalise_path.cc +++ b/src/actions/transformations/normalise_path.cc @@ -35,7 +35,7 @@ NormalisePath::NormalisePath(std::string action) this->action_kind = 1; } -std::string& NormalisePath::evaluate(std::string value, +std::string NormalisePath::evaluate(std::string value, Assay *assay) { /** * @todo Implement the transformation NormalisePath diff --git a/src/actions/transformations/normalise_path.h b/src/actions/transformations/normalise_path.h index c679bf96..38687753 100644 --- a/src/actions/transformations/normalise_path.h +++ b/src/actions/transformations/normalise_path.h @@ -31,7 +31,7 @@ namespace transformations { class NormalisePath : public Transformation { public: explicit NormalisePath(std::string action); - std::string& evaluate(std::string exp, + std::string evaluate(std::string exp, Assay *assay) override; }; diff --git a/src/actions/transformations/normalise_path_win.cc b/src/actions/transformations/normalise_path_win.cc index 192ad50b..52122acd 100644 --- a/src/actions/transformations/normalise_path_win.cc +++ b/src/actions/transformations/normalise_path_win.cc @@ -35,7 +35,7 @@ NormalisePathWin::NormalisePathWin(std::string action) this->action_kind = 1; } -std::string& NormalisePathWin::evaluate(std::string value, +std::string NormalisePathWin::evaluate(std::string value, Assay *assay) { /** * @todo Implement the transformation NormalisePathWin diff --git a/src/actions/transformations/normalise_path_win.h b/src/actions/transformations/normalise_path_win.h index 9db90139..e7650712 100644 --- a/src/actions/transformations/normalise_path_win.h +++ b/src/actions/transformations/normalise_path_win.h @@ -31,7 +31,7 @@ namespace transformations { class NormalisePathWin : public Transformation { public: explicit NormalisePathWin(std::string action); - std::string& evaluate(std::string exp, + std::string evaluate(std::string exp, Assay *assay) override; }; diff --git a/src/actions/transformations/parity_even_7bit.cc b/src/actions/transformations/parity_even_7bit.cc index eb2c0ea5..c9b7bea2 100644 --- a/src/actions/transformations/parity_even_7bit.cc +++ b/src/actions/transformations/parity_even_7bit.cc @@ -35,7 +35,7 @@ ParityEven7bit::ParityEven7bit(std::string action) this->action_kind = 1; } -std::string& ParityEven7bit::evaluate(std::string value, +std::string ParityEven7bit::evaluate(std::string value, Assay *assay) { /** * @todo Implement the transformation ParityEven7bit diff --git a/src/actions/transformations/parity_even_7bit.h b/src/actions/transformations/parity_even_7bit.h index 1dfc46ee..08c3ad82 100644 --- a/src/actions/transformations/parity_even_7bit.h +++ b/src/actions/transformations/parity_even_7bit.h @@ -31,7 +31,7 @@ namespace transformations { class ParityEven7bit : public Transformation { public: explicit ParityEven7bit(std::string action); - std::string& evaluate(std::string exp, + std::string evaluate(std::string exp, Assay *assay) override; }; diff --git a/src/actions/transformations/parity_odd_7bit.cc b/src/actions/transformations/parity_odd_7bit.cc index f9c10dd7..c34aa9d2 100644 --- a/src/actions/transformations/parity_odd_7bit.cc +++ b/src/actions/transformations/parity_odd_7bit.cc @@ -35,7 +35,7 @@ ParityOdd7bit::ParityOdd7bit(std::string action) this->action_kind = 1; } -std::string& ParityOdd7bit::evaluate(std::string value, +std::string ParityOdd7bit::evaluate(std::string value, Assay *assay) { /** * @todo Implement the transformation ParityOdd7bit diff --git a/src/actions/transformations/parity_odd_7bit.h b/src/actions/transformations/parity_odd_7bit.h index cc8d0c65..6599c839 100644 --- a/src/actions/transformations/parity_odd_7bit.h +++ b/src/actions/transformations/parity_odd_7bit.h @@ -31,7 +31,7 @@ namespace transformations { class ParityOdd7bit : public Transformation { public: explicit ParityOdd7bit(std::string action); - std::string& evaluate(std::string exp, + std::string evaluate(std::string exp, Assay *assay) override; }; diff --git a/src/actions/transformations/parity_zero_7bit.cc b/src/actions/transformations/parity_zero_7bit.cc index c6ee02af..05720d41 100644 --- a/src/actions/transformations/parity_zero_7bit.cc +++ b/src/actions/transformations/parity_zero_7bit.cc @@ -35,7 +35,7 @@ ParityZero7bit::ParityZero7bit(std::string action) this->action_kind = 1; } -std::string& ParityZero7bit::evaluate(std::string value, +std::string ParityZero7bit::evaluate(std::string value, Assay *assay) { /** * @todo Implement the transformation ParityZero7bit diff --git a/src/actions/transformations/parity_zero_7bit.h b/src/actions/transformations/parity_zero_7bit.h index 912f751a..bf00e3c9 100644 --- a/src/actions/transformations/parity_zero_7bit.h +++ b/src/actions/transformations/parity_zero_7bit.h @@ -31,7 +31,7 @@ namespace transformations { class ParityZero7bit : public Transformation { public: explicit ParityZero7bit(std::string action); - std::string& evaluate(std::string exp, + std::string evaluate(std::string exp, Assay *assay) override; }; diff --git a/src/actions/transformations/remove_comments.cc b/src/actions/transformations/remove_comments.cc index 89dd96cf..9f628e64 100644 --- a/src/actions/transformations/remove_comments.cc +++ b/src/actions/transformations/remove_comments.cc @@ -35,7 +35,7 @@ RemoveComments::RemoveComments(std::string action) this->action_kind = 1; } -std::string& RemoveComments::evaluate(std::string value, +std::string RemoveComments::evaluate(std::string value, Assay *assay) { /** * @todo Implement the transformation RemoveComments diff --git a/src/actions/transformations/remove_comments.h b/src/actions/transformations/remove_comments.h index 8d4022a9..48c7a41e 100644 --- a/src/actions/transformations/remove_comments.h +++ b/src/actions/transformations/remove_comments.h @@ -31,7 +31,7 @@ namespace transformations { class RemoveComments : public Transformation { public: explicit RemoveComments(std::string action); - std::string& evaluate(std::string exp, + std::string evaluate(std::string exp, Assay *assay) override; }; diff --git a/src/actions/transformations/remove_comments_char.cc b/src/actions/transformations/remove_comments_char.cc index 145b1486..cfd102d0 100644 --- a/src/actions/transformations/remove_comments_char.cc +++ b/src/actions/transformations/remove_comments_char.cc @@ -35,7 +35,7 @@ RemoveCommentsChar::RemoveCommentsChar(std::string action) this->action_kind = 1; } -std::string& RemoveCommentsChar::evaluate(std::string value, +std::string RemoveCommentsChar::evaluate(std::string value, Assay *assay) { /** * @todo Implement the transformation RemoveCommentsChar diff --git a/src/actions/transformations/remove_comments_char.h b/src/actions/transformations/remove_comments_char.h index 880d9cf7..d6832d1f 100644 --- a/src/actions/transformations/remove_comments_char.h +++ b/src/actions/transformations/remove_comments_char.h @@ -31,7 +31,7 @@ namespace transformations { class RemoveCommentsChar : public Transformation { public: explicit RemoveCommentsChar(std::string action); - std::string& evaluate(std::string exp, + std::string evaluate(std::string exp, Assay *assay) override; }; diff --git a/src/actions/transformations/remove_nulls.cc b/src/actions/transformations/remove_nulls.cc index bd94c4fa..08c15aea 100644 --- a/src/actions/transformations/remove_nulls.cc +++ b/src/actions/transformations/remove_nulls.cc @@ -35,7 +35,7 @@ RemoveNulls::RemoveNulls(std::string action) this->action_kind = 1; } -std::string& RemoveNulls::evaluate(std::string value, +std::string RemoveNulls::evaluate(std::string value, Assay *assay) { /** * @todo Implement the transformation RemoveNulls diff --git a/src/actions/transformations/remove_nulls.h b/src/actions/transformations/remove_nulls.h index a771518d..ba8671e2 100644 --- a/src/actions/transformations/remove_nulls.h +++ b/src/actions/transformations/remove_nulls.h @@ -31,7 +31,7 @@ namespace transformations { class RemoveNulls : public Transformation { public: explicit RemoveNulls(std::string action); - std::string& evaluate(std::string exp, + std::string evaluate(std::string exp, Assay *assay) override; }; diff --git a/src/actions/transformations/remove_whitespace.cc b/src/actions/transformations/remove_whitespace.cc index bd165dbe..4aff1dd0 100644 --- a/src/actions/transformations/remove_whitespace.cc +++ b/src/actions/transformations/remove_whitespace.cc @@ -35,7 +35,7 @@ RemoveWhitespace::RemoveWhitespace(std::string action) this->action_kind = 1; } -std::string& RemoveWhitespace::evaluate(std::string value, +std::string RemoveWhitespace::evaluate(std::string value, Assay *assay) { /** * @todo Implement the transformation RemoveWhitespace diff --git a/src/actions/transformations/remove_whitespace.h b/src/actions/transformations/remove_whitespace.h index bf59926e..46c74a13 100644 --- a/src/actions/transformations/remove_whitespace.h +++ b/src/actions/transformations/remove_whitespace.h @@ -31,7 +31,7 @@ namespace transformations { class RemoveWhitespace : public Transformation { public: explicit RemoveWhitespace(std::string action); - std::string& evaluate(std::string exp, + std::string evaluate(std::string exp, Assay *assay) override; }; diff --git a/src/actions/transformations/replace_comments.cc b/src/actions/transformations/replace_comments.cc index c318d0a2..06d1c6c5 100644 --- a/src/actions/transformations/replace_comments.cc +++ b/src/actions/transformations/replace_comments.cc @@ -35,7 +35,7 @@ ReplaceComments::ReplaceComments(std::string action) this->action_kind = 1; } -std::string& ReplaceComments::evaluate(std::string value, +std::string ReplaceComments::evaluate(std::string value, Assay *assay) { /** * @todo Implement the transformation ReplaceComments diff --git a/src/actions/transformations/replace_comments.h b/src/actions/transformations/replace_comments.h index 929a41ce..f76c39b1 100644 --- a/src/actions/transformations/replace_comments.h +++ b/src/actions/transformations/replace_comments.h @@ -31,7 +31,7 @@ namespace transformations { class ReplaceComments : public Transformation { public: explicit ReplaceComments(std::string action); - std::string& evaluate(std::string exp, + std::string evaluate(std::string exp, Assay *assay) override; }; diff --git a/src/actions/transformations/replace_nulls.cc b/src/actions/transformations/replace_nulls.cc index 09043572..cd4c7d43 100644 --- a/src/actions/transformations/replace_nulls.cc +++ b/src/actions/transformations/replace_nulls.cc @@ -35,7 +35,7 @@ ReplaceNulls::ReplaceNulls(std::string action) this->action_kind = 1; } -std::string& ReplaceNulls::evaluate(std::string value, +std::string ReplaceNulls::evaluate(std::string value, Assay *assay) { /** * @todo Implement the transformation ReplaceNulls diff --git a/src/actions/transformations/replace_nulls.h b/src/actions/transformations/replace_nulls.h index f849294f..1b3d34d6 100644 --- a/src/actions/transformations/replace_nulls.h +++ b/src/actions/transformations/replace_nulls.h @@ -31,7 +31,7 @@ namespace transformations { class ReplaceNulls : public Transformation { public: explicit ReplaceNulls(std::string action); - std::string& evaluate(std::string exp, + std::string evaluate(std::string exp, Assay *assay) override; }; diff --git a/src/actions/transformations/sha1.cc b/src/actions/transformations/sha1.cc index 64cb7a30..428830b5 100644 --- a/src/actions/transformations/sha1.cc +++ b/src/actions/transformations/sha1.cc @@ -35,7 +35,7 @@ Sha1::Sha1(std::string action) this->action_kind = 1; } -std::string& Sha1::evaluate(std::string value, +std::string Sha1::evaluate(std::string value, Assay *assay) { /** * @todo Implement the transformation Sha1 diff --git a/src/actions/transformations/sha1.h b/src/actions/transformations/sha1.h index f7303241..f24d2a90 100644 --- a/src/actions/transformations/sha1.h +++ b/src/actions/transformations/sha1.h @@ -31,7 +31,7 @@ namespace transformations { class Sha1 : public Transformation { public: explicit Sha1(std::string action); - std::string& evaluate(std::string exp, + std::string evaluate(std::string exp, Assay *assay) override; }; diff --git a/src/actions/transformations/sql_hex_decode.cc b/src/actions/transformations/sql_hex_decode.cc index e9fbd616..8ec45626 100644 --- a/src/actions/transformations/sql_hex_decode.cc +++ b/src/actions/transformations/sql_hex_decode.cc @@ -35,12 +35,13 @@ SqlHexDecode::SqlHexDecode(std::string action) this->action_kind = 1; } -std::string& SqlHexDecode::evaluate(std::string value, +std::string SqlHexDecode::evaluate(std::string value, Assay *assay) { /** * @todo Implement the transformation SqlHexDecode */ assay->debug(4, "Transformation SqlHexDecode is not implemented yet."); + return value; } } // namespace transformations diff --git a/src/actions/transformations/sql_hex_decode.h b/src/actions/transformations/sql_hex_decode.h index ba393cdc..8d8ada7c 100644 --- a/src/actions/transformations/sql_hex_decode.h +++ b/src/actions/transformations/sql_hex_decode.h @@ -31,7 +31,8 @@ namespace transformations { class SqlHexDecode : public Transformation { public: explicit SqlHexDecode(std::string action); - std::string& evaluate(std::string exp, + std::string + evaluate(std::string exp, Assay *assay) override; }; diff --git a/src/actions/transformations/transformation.cc b/src/actions/transformations/transformation.cc index a55ccb17..7f2d8d9e 100644 --- a/src/actions/transformations/transformation.cc +++ b/src/actions/transformations/transformation.cc @@ -72,7 +72,7 @@ Transformation::Transformation(std::string action) this->action_kind = 1; } -std::string &Transformation::evaluate(std::string value, +std::string Transformation::evaluate(std::string value, Assay *assay) { return value; } diff --git a/src/actions/transformations/transformation.h b/src/actions/transformations/transformation.h index 7b00fc45..6cef77e1 100644 --- a/src/actions/transformations/transformation.h +++ b/src/actions/transformations/transformation.h @@ -33,7 +33,7 @@ class Transformation : public Action { explicit Transformation(std::string action); static Transformation* instantiate(std::string); - std::string& evaluate(std::string exp, + std::string evaluate(std::string exp, Assay *assay) override; }; diff --git a/src/actions/transformations/trim.cc b/src/actions/transformations/trim.cc index f3ec6a94..be59eefa 100644 --- a/src/actions/transformations/trim.cc +++ b/src/actions/transformations/trim.cc @@ -56,7 +56,8 @@ Trim::Trim(std::string action) } -std::string& Trim::evaluate(std::string value, +std::string +Trim::evaluate(std::string value, Assay *assay) { return *this->trim(&value); } diff --git a/src/actions/transformations/trim.h b/src/actions/transformations/trim.h index 02b162e2..b44a2cd5 100644 --- a/src/actions/transformations/trim.h +++ b/src/actions/transformations/trim.h @@ -31,7 +31,7 @@ namespace transformations { class Trim : public Transformation { public: explicit Trim(std::string action); - std::string& evaluate(std::string exp, + std::string evaluate(std::string exp, Assay *assay) override; std::string *ltrim(std::string *s); diff --git a/src/actions/transformations/trim_left.cc b/src/actions/transformations/trim_left.cc index d4fd605c..403b8ae9 100644 --- a/src/actions/transformations/trim_left.cc +++ b/src/actions/transformations/trim_left.cc @@ -38,7 +38,7 @@ TrimLeft::TrimLeft(std::string action) this->action_kind = 1; } -std::string& TrimLeft::evaluate(std::string value, +std::string TrimLeft::evaluate(std::string value, Assay *assay) { return *trim(&value); } diff --git a/src/actions/transformations/trim_left.h b/src/actions/transformations/trim_left.h index 685a799f..c6e48502 100644 --- a/src/actions/transformations/trim_left.h +++ b/src/actions/transformations/trim_left.h @@ -32,7 +32,7 @@ namespace transformations { class TrimLeft : public Trim { public: explicit TrimLeft(std::string action); - std::string& evaluate(std::string exp, + std::string evaluate(std::string exp, Assay *assay) override; }; diff --git a/src/actions/transformations/trim_right.cc b/src/actions/transformations/trim_right.cc index 62c450bc..dab935db 100644 --- a/src/actions/transformations/trim_right.cc +++ b/src/actions/transformations/trim_right.cc @@ -36,7 +36,7 @@ TrimRight::TrimRight(std::string action) this->action_kind = 1; } -std::string& TrimRight::evaluate(std::string value, +std::string TrimRight::evaluate(std::string value, Assay *assay) { return *this->trim(&value); } diff --git a/src/actions/transformations/trim_right.h b/src/actions/transformations/trim_right.h index d91fdd23..497241d6 100644 --- a/src/actions/transformations/trim_right.h +++ b/src/actions/transformations/trim_right.h @@ -32,7 +32,7 @@ namespace transformations { class TrimRight : public Trim { public: explicit TrimRight(std::string action); - std::string& evaluate(std::string exp, + std::string evaluate(std::string exp, Assay *assay) override; }; diff --git a/src/actions/transformations/url_decode.cc b/src/actions/transformations/url_decode.cc index 008d7856..6d1e767b 100644 --- a/src/actions/transformations/url_decode.cc +++ b/src/actions/transformations/url_decode.cc @@ -35,7 +35,7 @@ UrlDecode::UrlDecode(std::string action) this->action_kind = 1; } -std::string& UrlDecode::evaluate(std::string value, +std::string UrlDecode::evaluate(std::string value, Assay *assay) { /** * @todo Implement the transformation UrlDecode diff --git a/src/actions/transformations/url_decode.h b/src/actions/transformations/url_decode.h index b39b8325..a3861c29 100644 --- a/src/actions/transformations/url_decode.h +++ b/src/actions/transformations/url_decode.h @@ -31,7 +31,7 @@ namespace transformations { class UrlDecode : public Transformation { public: explicit UrlDecode(std::string action); - std::string& evaluate(std::string exp, + std::string evaluate(std::string exp, Assay *assay) override; }; diff --git a/src/actions/transformations/url_decode_uni.cc b/src/actions/transformations/url_decode_uni.cc index bce7ace4..d9cbe2ae 100644 --- a/src/actions/transformations/url_decode_uni.cc +++ b/src/actions/transformations/url_decode_uni.cc @@ -35,7 +35,7 @@ UrlDecodeUni::UrlDecodeUni(std::string action) this->action_kind = 1; } -std::string& UrlDecodeUni::evaluate(std::string value, +std::string UrlDecodeUni::evaluate(std::string value, Assay *assay) { /** * @todo Implement the transformation UrlDecodeUni diff --git a/src/actions/transformations/url_decode_uni.h b/src/actions/transformations/url_decode_uni.h index 408bec8b..1203ce28 100644 --- a/src/actions/transformations/url_decode_uni.h +++ b/src/actions/transformations/url_decode_uni.h @@ -31,7 +31,7 @@ namespace transformations { class UrlDecodeUni : public Transformation { public: explicit UrlDecodeUni(std::string action); - std::string& evaluate(std::string exp, + std::string evaluate(std::string exp, Assay *assay) override; }; diff --git a/src/actions/transformations/url_encode.cc b/src/actions/transformations/url_encode.cc index 52be5b2b..8bce953c 100644 --- a/src/actions/transformations/url_encode.cc +++ b/src/actions/transformations/url_encode.cc @@ -35,7 +35,7 @@ UrlEncode::UrlEncode(std::string action) this->action_kind = 1; } -std::string& UrlEncode::evaluate(std::string value, +std::string UrlEncode::evaluate(std::string value, Assay *assay) { /** * @todo Implement the transformation UrlEncode diff --git a/src/actions/transformations/url_encode.h b/src/actions/transformations/url_encode.h index 8df35343..1028de08 100644 --- a/src/actions/transformations/url_encode.h +++ b/src/actions/transformations/url_encode.h @@ -31,7 +31,7 @@ namespace transformations { class UrlEncode : public Transformation { public: explicit UrlEncode(std::string action); - std::string& evaluate(std::string exp, + std::string evaluate(std::string exp, Assay *assay) override; }; diff --git a/src/actions/transformations/utf8_to_unicode.cc b/src/actions/transformations/utf8_to_unicode.cc index ddc80b04..725c55f7 100644 --- a/src/actions/transformations/utf8_to_unicode.cc +++ b/src/actions/transformations/utf8_to_unicode.cc @@ -35,7 +35,7 @@ Utf8Unicode::Utf8Unicode(std::string action) this->action_kind = 1; } -std::string& Utf8Unicode::evaluate(std::string value, +std::string Utf8Unicode::evaluate(std::string value, Assay *assay) { /** * @todo Implement the transformation Utf8Unicode diff --git a/src/actions/transformations/utf8_to_unicode.h b/src/actions/transformations/utf8_to_unicode.h index 6e70ed61..dc58d4b3 100644 --- a/src/actions/transformations/utf8_to_unicode.h +++ b/src/actions/transformations/utf8_to_unicode.h @@ -31,7 +31,7 @@ namespace transformations { class Utf8Unicode : public Transformation { public: explicit Utf8Unicode(std::string action); - std::string& evaluate(std::string exp, + std::string evaluate(std::string exp, Assay *assay) override; };