From 1933bb2eadf5ee14d526b79fe5492e7ae0b09f19 Mon Sep 17 00:00:00 2001 From: John Wiegley Date: Sat, 14 Feb 2009 04:46:53 -0400 Subject: Restored the --actual and --real options --- src/xact.cc | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'src/xact.cc') diff --git a/src/xact.cc b/src/xact.cc index 1942e175..24846cf2 100644 --- a/src/xact.cc +++ b/src/xact.cc @@ -80,6 +80,18 @@ namespace { return xact.has_flags(XACT_CALCULATED); } + value_t get_virtual(xact_t& xact) { + return xact.has_flags(XACT_VIRTUAL); + } + + value_t get_real(xact_t& xact) { + return ! xact.has_flags(XACT_VIRTUAL); + } + + value_t get_actual(xact_t& xact) { + return ! xact.has_flags(XACT_AUTO); + } + value_t get_entry(xact_t& xact) { return value_t(static_cast(xact.entry)); } @@ -172,6 +184,8 @@ expr_t::ptr_op_t xact_t::lookup(const string& name) return WRAP_FUNCTOR(get_account); else if (name == "account_base") return WRAP_FUNCTOR(get_wrapper<&get_account_base>); + else if (name == "actual") + return WRAP_FUNCTOR(get_wrapper<&get_actual>); break; case 'c': @@ -188,6 +202,11 @@ expr_t::ptr_op_t xact_t::lookup(const string& name) return WRAP_FUNCTOR(get_wrapper<&get_entry>); break; + case 'r': + if (name == "real") + return WRAP_FUNCTOR(get_wrapper<&get_real>); + break; + case 'p': if (name == "payee") return WRAP_FUNCTOR(get_wrapper<&get_payee>); @@ -200,6 +219,11 @@ expr_t::ptr_op_t xact_t::lookup(const string& name) return WRAP_FUNCTOR(get_wrapper<&get_total_cost>); break; + case 'v': + if (name == "virtual") + return WRAP_FUNCTOR(get_wrapper<&get_virtual>); + break; + case 'x': if (name == "xact") return WRAP_FUNCTOR(get_wrapper<&get_this>); -- cgit v1.2.3