summaryrefslogtreecommitdiff
path: root/src/mask.h
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2007-04-30 06:26:38 +0000
committerJohn Wiegley <johnw@newartisans.com>2008-04-13 03:38:33 -0400
commitc8899addfd2deed3d84be2de234681db64987722 (patch)
tree07f9a5eb603ff4ec83fe18c83083575d2b7a439a /src/mask.h
parentaa9cc125796711afcaa459898e95527fdae8e912 (diff)
downloadledger-c8899addfd2deed3d84be2de234681db64987722.tar.gz
ledger-c8899addfd2deed3d84be2de234681db64987722.tar.bz2
ledger-c8899addfd2deed3d84be2de234681db64987722.zip
Rearranged the sources a bit.
Diffstat (limited to 'src/mask.h')
-rw-r--r--src/mask.h26
1 files changed, 26 insertions, 0 deletions
diff --git a/src/mask.h b/src/mask.h
new file mode 100644
index 00000000..82634c19
--- /dev/null
+++ b/src/mask.h
@@ -0,0 +1,26 @@
+#ifndef _MASK_H
+#define _MASK_H
+
+#include "utils.h"
+
+#include <boost/regex.hpp>
+
+namespace ledger {
+
+class mask_t
+{
+ public:
+ bool exclude;
+ boost::regex expr;
+
+ explicit mask_t(const string& pattern);
+ mask_t(const mask_t& m) : exclude(m.exclude), expr(m.expr) {}
+
+ bool match(const string& str) const {
+ return boost::regex_match(str, expr) && ! exclude;
+ }
+};
+
+} // namespace ledger
+
+#endif // _MASK_H