diff options
author | John Wiegley <johnw@newartisans.com> | 2009-02-15 21:48:22 -0400 |
---|---|---|
committer | John Wiegley <johnw@newartisans.com> | 2009-02-15 21:48:22 -0400 |
commit | 503a96034e623334a3c3708543cf74c3f254aaa1 (patch) | |
tree | 17a685d093859a746bd8a42c6e0faf614a975c89 /src/account.cc | |
parent | a64a069a77ac168628bda971672d02e26204c654 (diff) | |
download | fork-ledger-503a96034e623334a3c3708543cf74c3f254aaa1.tar.gz fork-ledger-503a96034e623334a3c3708543cf74c3f254aaa1.tar.bz2 fork-ledger-503a96034e623334a3c3708543cf74c3f254aaa1.zip |
Added account(_base) accessors to account_t
Diffstat (limited to 'src/account.cc')
-rw-r--r-- | src/account.cc | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/account.cc b/src/account.cc index 38a3eae8..6331bfb2 100644 --- a/src/account.cc +++ b/src/account.cc @@ -156,6 +156,14 @@ namespace { return string_value(account.partial_name()); } + value_t get_account(account_t& account) { // this gets the name + return string_value(account.fullname()); + } + + value_t get_account_base(account_t& account) { + return string_value(account.name); + } + value_t get_total(account_t& account) { assert(account.xdata_); return account.xdata_->total; @@ -204,6 +212,10 @@ expr_t::ptr_op_t account_t::lookup(const string& name) case 'a': if (name == "amount") return WRAP_FUNCTOR(get_wrapper<&get_amount>); + else if (name == "account") + return WRAP_FUNCTOR(get_wrapper<&get_account>); + else if (name == "account_base") + return WRAP_FUNCTOR(get_wrapper<&get_account_base>); break; case 'c': |