summaryrefslogtreecommitdiff
path: root/src/output.h
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2009-11-11 02:01:24 -0500
committerJohn Wiegley <johnw@newartisans.com>2009-11-11 02:01:24 -0500
commita4b1e7c5ab70fc846b0ec4762f2e9f8ee242ca11 (patch)
tree5d8324b0176b61963db117dfce2ed0ef61b32e9b /src/output.h
parenteb772893b00119ead26d8662d73460651cafe11d (diff)
downloadfork-ledger-a4b1e7c5ab70fc846b0ec4762f2e9f8ee242ca11.tar.gz
fork-ledger-a4b1e7c5ab70fc846b0ec4762f2e9f8ee242ca11.tar.bz2
fork-ledger-a4b1e7c5ab70fc846b0ec4762f2e9f8ee242ca11.zip
Added a --prepend-format option
This lets you, for example, debug registers that cull data from many different sources, without having to change the basic formatting string. You can locate each posting's location with this: ledger reg --prepend-format='%-25(filename + ":" + beg_line)'
Diffstat (limited to 'src/output.h')
-rw-r--r--src/output.h8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/output.h b/src/output.h
index fedd08ff..778a9335 100644
--- a/src/output.h
+++ b/src/output.h
@@ -60,13 +60,15 @@ protected:
format_t first_line_format;
format_t next_lines_format;
format_t between_format;
+ format_t prepend_format;
xact_t * last_xact;
post_t * last_post;
bool print_raw;
public:
format_posts(report_t& _report, const string& format,
- bool _print_raw = false);
+ bool _print_raw = false,
+ const optional<string>& _prepend_format = none);
virtual ~format_posts() {
TRACE_DTOR(format_posts);
}
@@ -82,12 +84,14 @@ protected:
format_t account_line_format;
format_t total_line_format;
format_t separator_format;
+ format_t prepend_format;
predicate_t disp_pred;
std::list<account_t *> posted_accounts;
public:
- format_accounts(report_t& _report, const string& _format);
+ format_accounts(report_t& _report, const string& _format,
+ const optional<string>& _prepend_format = none);
virtual ~format_accounts() {
TRACE_DTOR(format_accounts);
}