diff options
author | John Wiegley <johnw@newartisans.com> | 2007-04-19 20:31:46 +0000 |
---|---|---|
committer | John Wiegley <johnw@newartisans.com> | 2008-04-13 03:38:28 -0400 |
commit | 0a6b5726ec3bf402a953ea8a03b98ecbf4b90b0c (patch) | |
tree | 0a2c2aca7100d045f491b03f0a5bda92378d3ef9 /mask.h | |
parent | 176b3044e355398a0c31e0c42a3cd7b8a2e3f3e5 (diff) | |
download | fork-ledger-0a6b5726ec3bf402a953ea8a03b98ecbf4b90b0c.tar.gz fork-ledger-0a6b5726ec3bf402a953ea8a03b98ecbf4b90b0c.tar.bz2 fork-ledger-0a6b5726ec3bf402a953ea8a03b98ecbf4b90b0c.zip |
Made the amount/balance/value interface a bit more rational; added
back a useless version of the register command (just to prove the
command sequence); and added smart XML semantics to the XPath
implementation so that nodes can be coerced to values.
Diffstat (limited to 'mask.h')
-rw-r--r-- | mask.h | 14 |
1 files changed, 8 insertions, 6 deletions
@@ -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 { |