diff options
author | John Wiegley <johnw@newartisans.com> | 2007-04-20 02:14:53 +0000 |
---|---|---|
committer | John Wiegley <johnw@newartisans.com> | 2008-04-13 03:38:28 -0400 |
commit | b84f676946941df6f7e8476d77d1db0cbe7736c5 (patch) | |
tree | 9ee7c7a2d3b7496b38ad127519210adfeced2241 /mask.h | |
parent | 539370ff1b37772e9f11439f652ffd3583beeedb (diff) | |
download | fork-ledger-b84f676946941df6f7e8476d77d1db0cbe7736c5.tar.gz fork-ledger-b84f676946941df6f7e8476d77d1db0cbe7736c5.tar.bz2 fork-ledger-b84f676946941df6f7e8476d77d1db0cbe7736c5.zip |
Did some optimization and memory cleanup
Diffstat (limited to 'mask.h')
-rw-r--r-- | mask.h | 10 |
1 files changed, 7 insertions, 3 deletions
@@ -8,24 +8,28 @@ #include <boost/regex.hpp> +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 |