diff options
author | John Wiegley <johnw@newartisans.com> | 2009-02-12 03:06:15 -0400 |
---|---|---|
committer | John Wiegley <johnw@newartisans.com> | 2009-02-12 03:06:15 -0400 |
commit | dc68903bb219c3fdaa17e2aa78a7ee5edfd74f0b (patch) | |
tree | 4c6d2527d2d83e3e3102dc5f3c8c278b73c96784 /src/mask.h | |
parent | eaac95147c91c1bb425e8a71e35bcf7d3c3aaf9d (diff) | |
download | fork-ledger-dc68903bb219c3fdaa17e2aa78a7ee5edfd74f0b.tar.gz fork-ledger-dc68903bb219c3fdaa17e2aa78a7ee5edfd74f0b.tar.bz2 fork-ledger-dc68903bb219c3fdaa17e2aa78a7ee5edfd74f0b.zip |
Added validation code for mask_t objects.
Diffstat (limited to 'src/mask.h')
-rw-r--r-- | src/mask.h | 11 |
1 files changed, 11 insertions, 0 deletions
@@ -77,12 +77,23 @@ public: } bool match(const string& str) const { + DEBUG("mask.match", + "Matching: \"" << str << "\" =~ /" << expr.str() << "/ = " + << (boost::regex_search(str, expr) ? "true" : "false")); return boost::regex_search(str, expr); } bool empty() const { return expr.empty(); } + + bool valid() const { + if (expr.status() != 0) { + DEBUG("ledger.validate", "mask_t: expr.status() != 0"); + return false; + } + return true; + } }; inline std::ostream& operator<<(std::ostream& out, const mask_t& mask) { |