summaryrefslogtreecommitdiff
path: root/mask.h
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2007-04-20 02:14:53 +0000
committerJohn Wiegley <johnw@newartisans.com>2008-04-13 03:38:28 -0400
commitb84f676946941df6f7e8476d77d1db0cbe7736c5 (patch)
tree9ee7c7a2d3b7496b38ad127519210adfeced2241 /mask.h
parent539370ff1b37772e9f11439f652ffd3583beeedb (diff)
downloadfork-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.h10
1 files changed, 7 insertions, 3 deletions
diff --git a/mask.h b/mask.h
index e7febeb0..13ab57b5 100644
--- a/mask.h
+++ b/mask.h
@@ -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