Added the "depth" value expression function for accounts.

This commit is contained in:
John Wiegley 2008-08-14 04:13:18 -04:00
parent b488d1d62f
commit ad02a482b6

View file

@ -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]) {