diff options
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 |