Adds support for trim, left and right trim

This commit is contained in:
Felipe Zimmerle
2015-10-21 14:07:20 -03:00
parent 59af8ab842
commit 17faef565e
6 changed files with 13 additions and 13 deletions

View File

@@ -101,9 +101,9 @@ Transformation* Transformation::instantiate(std::string a) {
IF_MATCH(sha1) { return new Sha1(a); }
IF_MATCH(sql_hex_decode) { return new SqlHexDecode(a); }
IF_MATCH(transformation) { return new Transformation(a); }
IF_MATCH(trimLeft) { return new TrimLeft(a); }
IF_MATCH(trimRight) { return new TrimRight(a); }
IF_MATCH(trim) { return new Trim(a); }
IF_MATCH(trim_left) { return new TrimLeft(a); }
IF_MATCH(trim_right) { return new TrimRight(a); }
IF_MATCH(url_decode) { return new UrlDecode(a); }
IF_MATCH(urlDecodeUni) { return new UrlDecodeUni(a); }
IF_MATCH(url_encode) { return new UrlEncode(a); }

View File

@@ -40,7 +40,7 @@ TrimLeft::TrimLeft(std::string action)
std::string TrimLeft::evaluate(std::string value,
Assay *assay) {
return *trim(&value);
return *ltrim(&value);
}
} // namespace transformations

View File

@@ -38,7 +38,7 @@ TrimRight::TrimRight(std::string action)
std::string TrimRight::evaluate(std::string value,
Assay *assay) {
return *this->trim(&value);
return *this->rtrim(&value);
}
} // namespace transformations