summaryrefslogtreecommitdiff
path: root/src/account.cc
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2010-06-06 06:03:56 -0400
committerJohn Wiegley <johnw@newartisans.com>2010-06-06 06:03:56 -0400
commit41e4aea7595d3b9009bece4902d9efdb8ba00e6c (patch)
tree015786c2b4c178ad06dfcf65a20495d0cc6bf5db /src/account.cc
parent6c01e4e0905007624fa6c68b598138cb0c919e76 (diff)
downloadfork-ledger-41e4aea7595d3b9009bece4902d9efdb8ba00e6c.tar.gz
fork-ledger-41e4aea7595d3b9009bece4902d9efdb8ba00e6c.tar.bz2
fork-ledger-41e4aea7595d3b9009bece4902d9efdb8ba00e6c.zip
Made lookup of an account's "cost" a calc error
Diffstat (limited to 'src/account.cc')
-rw-r--r--src/account.cc6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/account.cc b/src/account.cc
index e577c48e..37ff83f3 100644
--- a/src/account.cc
+++ b/src/account.cc
@@ -205,6 +205,10 @@ namespace {
value_t get_count(account_t& account) {
return long(account.family_details().posts_count);
}
+ value_t get_cost(account_t&) {
+ throw_(calc_error, _("An account does not have a 'cost' value"));
+ return false;
+ }
value_t get_depth(account_t& account) {
return long(account.depth);
@@ -311,6 +315,8 @@ expr_t::ptr_op_t account_t::lookup(const symbol_t::kind_t kind,
case 'c':
if (name == "count")
return WRAP_FUNCTOR(get_wrapper<&get_count>);
+ else if (name == "cost")
+ return WRAP_FUNCTOR(get_wrapper<&get_cost>);
break;
case 'd':