summaryrefslogtreecommitdiff
path: root/constraint.cc
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2004-07-27 01:33:41 -0400
committerJohn Wiegley <johnw@newartisans.com>2004-07-27 01:33:41 -0400
commitdd5680c2674fe9ce458941ec9b3978cd7dda9bff (patch)
tree6f54757768b36ef3ab9590d490f1c96e4b798c11 /constraint.cc
parent161d6f79bd6f4ab45afa1cbae77548c8e508809a (diff)
downloadfork-ledger-dd5680c2674fe9ce458941ec9b3978cd7dda9bff.tar.gz
fork-ledger-dd5680c2674fe9ce458941ec9b3978cd7dda9bff.tar.bz2
fork-ledger-dd5680c2674fe9ce458941ec9b3978cd7dda9bff.zip
reorganized report.cc into item.cc, expr.cc and format.cc
Diffstat (limited to 'constraint.cc')
-rw-r--r--constraint.cc12
1 files changed, 9 insertions, 3 deletions
diff --git a/constraint.cc b/constraint.cc
index 1248c2b1..0af49502 100644
--- a/constraint.cc
+++ b/constraint.cc
@@ -1,9 +1,16 @@
#include "constraint.h"
+#include "expr.h"
#include <pcre.h>
namespace ledger {
+constraints_t::~constraints_t()
+{
+ if (predicate) delete predicate;
+ if (sort_order) delete sort_order;
+}
+
mask_t::mask_t(const std::string& pat) : exclude(false)
{
const char * p = pat.c_str();
@@ -183,14 +190,13 @@ bool constraints_t::operator ()(const entry_t * entry) const
bool constraints_t::operator ()(const item_t * item) const
{
- if (predicate && ! predicate->compute(begin(), end(), item))
+ if (predicate && ! predicate->compute(item, begin(), end()))
return false;
if (! matches_date_range(item->date))
return false;
- if (! payee_masks.empty() &&
- ! (matches(payee_masks, item->payee)))
+ if (! payee_masks.empty() && ! matches(payee_masks, item->payee))
return false;
#if 0