summaryrefslogtreecommitdiff
path: root/mask.h
diff options
context:
space:
mode:
Diffstat (limited to 'mask.h')
-rw-r--r--mask.h14
1 files changed, 8 insertions, 6 deletions
diff --git a/mask.h b/mask.h
index ed00806e..e7febeb0 100644
--- a/mask.h
+++ b/mask.h
@@ -6,18 +6,20 @@
#include <string>
#include <exception>
+#include <boost/regex.hpp>
+
class mask_t
{
public:
- bool exclude;
- std::string pattern;
- void * regexp;
+ bool exclude;
+ boost::regex expr;
explicit mask_t(const std::string& pattern);
- mask_t(const mask_t&);
- ~mask_t();
+ mask_t(const mask_t& m) : exclude(m.exclude), expr(m.expr) {}
- bool match(const std::string& str) const;
+ bool match(const std::string& str) const {
+ return boost::regex_match(str, expr) && ! exclude;
+ }
};
class mask_error : public error {