From 647d4aac2fa474085d01f7ea1cebdc34fafd64a6 Mon Sep 17 00:00:00 2001 From: John Wiegley Date: Sun, 30 May 2010 02:28:58 -0600 Subject: New: --group-by=EXPR and --group-title-format=FMT The --group-by option allows for most reports to be split up into sections based on the varying value of EXPR. For example, to see register subtotals by payee, use: ledger reg --group-by=payee -s This works for separated balances too: ledger bal --group-by=payee Another interesting possibility is seeing a register of all the accounts affected by a related account: ledger reg -r --group-by=payee The option --group-title-format can be used to add a separator bar to the group titles. The option --no-titles can be used to drop titles altogether. --- src/chain.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'src/chain.h') diff --git a/src/chain.h b/src/chain.h index 935f2935..59b04eb8 100644 --- a/src/chain.h +++ b/src/chain.h @@ -91,11 +91,25 @@ typedef shared_ptr > post_handler_ptr; typedef shared_ptr > acct_handler_ptr; class report_t; + +post_handler_ptr +chain_pre_post_handlers(report_t& report, + post_handler_ptr base_handler); + post_handler_ptr chain_post_handlers(report_t& report, post_handler_ptr base_handler, bool for_accounts_report = false); +inline post_handler_ptr +chain_handlers(report_t& report, + post_handler_ptr handler, + bool for_accounts_report = false) { + handler = chain_post_handlers(report, handler, for_accounts_report); + handler = chain_pre_post_handlers(report, handler); + return handler; +} + } // namespace ledger #endif // _CHAIN_H -- cgit v1.2.3