diff options
author | John Wiegley <johnw@newartisans.com> | 2012-02-27 03:55:36 -0600 |
---|---|---|
committer | John Wiegley <johnw@newartisans.com> | 2012-02-27 03:55:36 -0600 |
commit | 4dd536c670c69a2c65d30281b32597d6e708ff8c (patch) | |
tree | cf321eed97a96651552cdf84cfca439fb3b0b5c5 /src/account.cc | |
parent | 822919984ec8ba2d02bf4fb33c8df9e4378bc519 (diff) | |
download | fork-ledger-4dd536c670c69a2c65d30281b32597d6e708ff8c.tar.gz fork-ledger-4dd536c670c69a2c65d30281b32597d6e708ff8c.tar.bz2 fork-ledger-4dd536c670c69a2c65d30281b32597d6e708ff8c.zip |
Add "note" valexpr function to accounts
Diffstat (limited to 'src/account.cc')
-rw-r--r-- | src/account.cc | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/account.cc b/src/account.cc index e201be64..42c10839 100644 --- a/src/account.cc +++ b/src/account.cc @@ -243,6 +243,10 @@ namespace { return long(account.depth); } + value_t get_note(account_t& account) { + return account.note ? string_value(*account.note) : NULL_VALUE; + } + value_t ignore(account_t&) { return false; } @@ -368,6 +372,8 @@ expr_t::ptr_op_t account_t::lookup(const symbol_t::kind_t kind, case 'n': if (fn_name[1] == '\0') return WRAP_FUNCTOR(get_wrapper<&get_subcount>); + else if (fn_name == "note") + return WRAP_FUNCTOR(get_wrapper<&get_note>); break; case 'p': |