From b84f676946941df6f7e8476d77d1db0cbe7736c5 Mon Sep 17 00:00:00 2001 From: John Wiegley Date: Fri, 20 Apr 2007 02:14:53 +0000 Subject: Did some optimization and memory cleanup --- mask.h | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'mask.h') diff --git a/mask.h b/mask.h index e7febeb0..13ab57b5 100644 --- a/mask.h +++ b/mask.h @@ -8,24 +8,28 @@ #include +namespace ledger { + class mask_t { public: bool exclude; boost::regex expr; - explicit mask_t(const std::string& pattern); + explicit mask_t(const string& pattern); mask_t(const mask_t& m) : exclude(m.exclude), expr(m.expr) {} - bool match(const std::string& str) const { + bool match(const string& str) const { return boost::regex_match(str, expr) && ! exclude; } }; class mask_error : public error { public: - mask_error(const std::string& _reason) throw() : error(_reason) {} + mask_error(const string& _reason) throw() : error(_reason) {} virtual ~mask_error() throw() {} }; +} // namespace ledger + #endif // _MASK_H -- cgit v1.2.3