diff --git a/libwccl/ops/regex.cpp b/libwccl/ops/regex.cpp index 818352918af9d15cd5b3a4cecc60a08bdf18f9f1..8b44177334f9bd9ea8f47d3677bc7a8092b1ba6e 100644 --- a/libwccl/ops/regex.cpp +++ b/libwccl/ops/regex.cpp @@ -8,13 +8,13 @@ RegexParseError::RegexParseError( const UnicodeString& pattern, const UErrorCode& status_code, const UParseError& parse_error) - : status(u_errorName(status_code)), + : WcclError("Could not parse regular expression."), + status(u_errorName(status_code)), pattern_line(parse_error.line), offset(parse_error.offset), pre_context(PwrNlp::to_utf8(UnicodeString(parse_error.preContext))), error(PwrNlp::to_utf8(UnicodeString(parse_error.postContext))), - expression(pattern.toUTF8String(std::string())), - WcclError("Could not parse regular expression: " + status + ":" + error) + expression(PwrNlp::to_utf8(UnicodeString(pattern))) { } @@ -27,6 +27,10 @@ std::string RegexParseError::info() const return ss.str(); } +RegexParseError::~RegexParseError() throw() +{ +} + boost::shared_ptr<const RegexPattern> compile_regex(const UnicodeString &pat_str) { UParseError error; diff --git a/libwccl/ops/regex.h b/libwccl/ops/regex.h index 93689aec586d45d02b145053aad7dd9f849aee03..63784f0c80ec260232e4483a586a2f0350175553 100644 --- a/libwccl/ops/regex.h +++ b/libwccl/ops/regex.h @@ -66,6 +66,8 @@ public: const UErrorCode& status_code, const UParseError& parse_error); + ~RegexParseError() throw(); + std::string info() const; const std::string status;