From dc68903bb219c3fdaa17e2aa78a7ee5edfd74f0b Mon Sep 17 00:00:00 2001 From: John Wiegley Date: Thu, 12 Feb 2009 03:06:15 -0400 Subject: Added validation code for mask_t objects. --- src/mask.h | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'src/mask.h') diff --git a/src/mask.h b/src/mask.h index 6b17cf61..065d06a2 100644 --- a/src/mask.h +++ b/src/mask.h @@ -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) { -- cgit v1.2.3