diff options
author | John Wiegley <johnw@newartisans.com> | 2005-11-09 01:30:15 +0000 |
---|---|---|
committer | John Wiegley <johnw@newartisans.com> | 2008-04-13 02:41:20 -0400 |
commit | 3b88c287b0972af6d57ae88a0b4222813675a96a (patch) | |
tree | 106e8f3e1c6ad8dc91d50fbecd8fda31eea8413d /valexpr.cc | |
parent | aadc36a65ae4295543b61bfd1362b0bc735a92a5 (diff) | |
download | fork-ledger-3b88c287b0972af6d57ae88a0b4222813675a96a.tar.gz fork-ledger-3b88c287b0972af6d57ae88a0b4222813675a96a.tar.bz2 fork-ledger-3b88c287b0972af6d57ae88a0b4222813675a96a.zip |
Added support for a Y flag which matches against a transaction's
PENDING state (as opposed to X, which checks only CLEARED). Now it
should be possible to query for all combinations of PENDING, CLEARED
or UNCLEARED.
Diffstat (limited to 'valexpr.cc')
-rw-r--r-- | valexpr.cc | 9 |
1 files changed, 9 insertions, 0 deletions
@@ -116,12 +116,19 @@ void value_expr_t::compute(value_t& result, const details_t& details) const else result = long(terminus); break; + case CLEARED: if (details.xact) result = details.xact->state == transaction_t::CLEARED; else result = false; break; + case PENDING: + if (details.xact) + result = details.xact->state == transaction_t::PENDING; + else + result = false; + break; case REAL: if (details.xact) @@ -462,6 +469,7 @@ value_expr_t * parse_value_term(std::istream& in) case 'b': node.reset(new value_expr_t(value_expr_t::COST)); break; case 'd': node.reset(new value_expr_t(value_expr_t::DATE)); break; case 'X': node.reset(new value_expr_t(value_expr_t::CLEARED)); break; + case 'Y': node.reset(new value_expr_t(value_expr_t::PENDING)); break; case 'R': node.reset(new value_expr_t(value_expr_t::REAL)); break; case 'L': node.reset(new value_expr_t(value_expr_t::ACTUAL)); break; case 'n': node.reset(new value_expr_t(value_expr_t::INDEX)); break; @@ -848,6 +856,7 @@ void dump_value_expr(std::ostream& out, const value_expr_t * node) case value_expr_t::COST: out << "COST"; break; case value_expr_t::DATE: out << "DATE"; break; case value_expr_t::CLEARED: out << "CLEARED"; break; + case value_expr_t::PENDING: out << "PENDING"; break; case value_expr_t::REAL: out << "REAL"; break; case value_expr_t::ACTUAL: out << "ACTUAL"; break; case value_expr_t::INDEX: out << "INDEX"; break; |