summaryrefslogtreecommitdiff
path: root/src/predicate.h
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2009-02-04 19:55:27 -0400
committerJohn Wiegley <johnw@newartisans.com>2009-02-04 19:55:27 -0400
commit2d941730b1c60342be5b108d2d654723b3b7c2cb (patch)
tree6a3f4b7305857e85d2684670492007bafc3668d0 /src/predicate.h
parent73cf3b01fbd50c3a8a4fd96ff69643c28394d8fe (diff)
downloadfork-ledger-2d941730b1c60342be5b108d2d654723b3b7c2cb.tar.gz
fork-ledger-2d941730b1c60342be5b108d2d654723b3b7c2cb.tar.bz2
fork-ledger-2d941730b1c60342be5b108d2d654723b3b7c2cb.zip
Largely removed all of Ledger's use of global variables, for the REPL's sake.
Diffstat (limited to 'src/predicate.h')
-rw-r--r--src/predicate.h20
1 files changed, 13 insertions, 7 deletions
diff --git a/src/predicate.h b/src/predicate.h
index 5e2057ca..dfdcd256 100644
--- a/src/predicate.h
+++ b/src/predicate.h
@@ -60,26 +60,32 @@ template <typename T>
class item_predicate
{
public:
- expr_t predicate;
+ expr_t predicate;
+ keep_details_t what_to_keep;
item_predicate() {
TRACE_CTOR(item_predicate, "");
}
- item_predicate(const item_predicate& other) : predicate(other.predicate) {
+ item_predicate(const item_predicate& other)
+ : predicate(other.predicate), what_to_keep(other.what_to_keep) {
TRACE_CTOR(item_predicate, "copy");
}
- item_predicate(const expr_t& _predicate) : predicate(_predicate) {
- TRACE_CTOR(item_predicate, "const expr_t&");
+ item_predicate(const expr_t& _predicate,
+ const keep_details_t& _what_to_keep)
+ : predicate(_predicate), what_to_keep(_what_to_keep) {
+ TRACE_CTOR(item_predicate, "const expr_t&, const keep_details_t&");
}
- item_predicate(const string& _predicate) : predicate(expr_t(_predicate)) {
- TRACE_CTOR(item_predicate, "const string&");
+ item_predicate(const string& _predicate,
+ const keep_details_t& _what_to_keep)
+ : predicate(expr_t(_predicate)), what_to_keep(_what_to_keep) {
+ TRACE_CTOR(item_predicate, "const string&, const keep_details_t&");
}
~item_predicate() throw() {
TRACE_DTOR(item_predicate);
}
bool operator()(T& item) {
- return ! predicate || predicate.calc(item).strip_annotations();
+ return ! predicate || predicate.calc(item).strip_annotations(what_to_keep);
}
};