From 4dd536c670c69a2c65d30281b32597d6e708ff8c Mon Sep 17 00:00:00 2001 From: John Wiegley Date: Mon, 27 Feb 2012 03:55:36 -0600 Subject: Add "note" valexpr function to accounts --- src/account.cc | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/account.cc') 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': -- cgit v1.2.3