summaryrefslogtreecommitdiff
path: root/src/xact.cc
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2009-02-14 04:46:53 -0400
committerJohn Wiegley <johnw@newartisans.com>2009-02-14 04:46:53 -0400
commit1933bb2eadf5ee14d526b79fe5492e7ae0b09f19 (patch)
tree8d4401f4279563450ed5ede6e5650804cc7bd73a /src/xact.cc
parent5290b6e8aa2c81011a32d1cea807c93c30147a50 (diff)
downloadfork-ledger-1933bb2eadf5ee14d526b79fe5492e7ae0b09f19.tar.gz
fork-ledger-1933bb2eadf5ee14d526b79fe5492e7ae0b09f19.tar.bz2
fork-ledger-1933bb2eadf5ee14d526b79fe5492e7ae0b09f19.zip
Restored the --actual and --real options
Diffstat (limited to 'src/xact.cc')
-rw-r--r--src/xact.cc24
1 files changed, 24 insertions, 0 deletions
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<scope_t *>(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>);