From cb14466431e2e1ce56d47fcd3c3ec98d0fa1fa29 Mon Sep 17 00:00:00 2001 From: fluxgen Date: Fri, 13 Jun 2003 11:43:46 +0000 Subject: minor fixes --- src/RegExp.cc | 14 +++++++++++--- src/RegExp.hh | 16 ++++++++-------- 2 files changed, 19 insertions(+), 11 deletions(-) diff --git a/src/RegExp.cc b/src/RegExp.cc index 2e991da..093c53f 100644 --- a/src/RegExp.cc +++ b/src/RegExp.cc @@ -20,7 +20,7 @@ // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: RegExp.cc,v 1.1 2003/06/12 15:12:19 rathnor Exp $ +// $Id: RegExp.cc,v 1.2 2003/06/13 11:43:46 fluxgen Exp $ #include "RegExp.hh" @@ -81,10 +81,10 @@ RegExp::~RegExp() { #endif // USE_REGEXP } -bool RegExp::match(const std::string &str) { +bool RegExp::match(const std::string &str) const { #ifdef USE_REGEXP if (m_regex) - return (regexec(m_regex, str.c_str(), 0, 0, 0) == 0); + return regexec(m_regex, str.c_str(), 0, 0, 0) == 0; else return false; #else // notdef USE_REGEXP @@ -92,3 +92,11 @@ bool RegExp::match(const std::string &str) { #endif // USE_REGEXP } + +bool RegExp::error() const { +#ifdef USE_REGEXP + return m_regex == 0; +#else + return return m_str == ""; +#endif // USE_REGEXP +} diff --git a/src/RegExp.hh b/src/RegExp.hh index 9591bcb..f5f5fd6 100644 --- a/src/RegExp.hh +++ b/src/RegExp.hh @@ -21,12 +21,16 @@ // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: RegExp.hh,v 1.1 2003/06/12 15:12:19 rathnor Exp $ +// $Id: RegExp.hh,v 1.2 2003/06/13 11:43:46 fluxgen Exp $ #ifndef REGEXP_HH #define REGEXP_HH +#include "NotCopyable.hh" + +#ifdef HAVE_CONFIG_H #include "config.h" +#endif // HAVE_CONFIG_H #include @@ -41,18 +45,14 @@ class WinClient; -class RegExp { +class RegExp:private FbTk::NotCopyable { public: RegExp(const std::string &str, bool full_match = true); ~RegExp(); - bool match(const std::string &str); + bool match(const std::string &str) const; -#ifdef USE_REGEXP - inline bool error() { return m_regex == 0; } -#else // notdef USE_REGEXP - inline bool error() { return m_str == ""; } -#endif // USE_REGEXP + bool error() const; private: #ifdef USE_REGEXP -- cgit v0.11.2