summaryrefslogtreecommitdiff
path: root/src/account.cc
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2008-08-14 04:13:18 -0400
committerJohn Wiegley <johnw@newartisans.com>2008-08-14 04:13:18 -0400
commitad02a482b6ee5bfd273acaa8730eb741b50f37f6 (patch)
tree05265a7396a605043daa9c2284e3e16076215f52 /src/account.cc
parentb488d1d62f560e6e2c085134fdb940e53e756ae1 (diff)
downloadfork-ledger-ad02a482b6ee5bfd273acaa8730eb741b50f37f6.tar.gz
fork-ledger-ad02a482b6ee5bfd273acaa8730eb741b50f37f6.tar.bz2
fork-ledger-ad02a482b6ee5bfd273acaa8730eb741b50f37f6.zip
Added the "depth" value expression function for accounts.
Diffstat (limited to 'src/account.cc')
-rw-r--r--src/account.cc9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/account.cc b/src/account.cc
index f613d983..f1ac713e 100644
--- a/src/account.cc
+++ b/src/account.cc
@@ -143,6 +143,10 @@ namespace {
return account.xdata_->value;
}
+ value_t get_depth(account_t& account) {
+ return long(account.depth);
+ }
+
value_t get_depth_spacer(account_t& account) {
std::ostringstream out;
for (account_t * acct = &account;
@@ -168,6 +172,11 @@ expr_t::ptr_op_t account_t::lookup(const string& name)
return WRAP_FUNCTOR(get_wrapper<&get_amount>);
break;
+ case 'd':
+ if (name == "depth")
+ return WRAP_FUNCTOR(get_wrapper<&get_depth>);
+ break;
+
case 'f':
if (name.find("fmt_") == 0) {
switch (name[4]) {