summaryrefslogtreecommitdiff
path: root/src/output.h
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2008-08-14 04:14:48 -0400
committerJohn Wiegley <johnw@newartisans.com>2008-08-14 04:14:48 -0400
commit6432d7c594023fa5a4fbc9072c28bdd80b670c8a (patch)
tree56e9b2f88cb3ebf2968bb510c3f82662601d7373 /src/output.h
parent2bff7565c1762202c7c01bf7cb50bd9ce351031a (diff)
downloadfork-ledger-6432d7c594023fa5a4fbc9072c28bdd80b670c8a.tar.gz
fork-ledger-6432d7c594023fa5a4fbc9072c28bdd80b670c8a.tar.bz2
fork-ledger-6432d7c594023fa5a4fbc9072c28bdd80b670c8a.zip
Added back a lot of hacktastic logic from 2.6.1 that made the "bal" command
somewhat smart about how it interpreted certain options. Beware, code, for your days are not long-lived.
Diffstat (limited to 'src/output.h')
-rw-r--r--src/output.h18
1 files changed, 10 insertions, 8 deletions
diff --git a/src/output.h b/src/output.h
index 3fe1ce71..df556235 100644
--- a/src/output.h
+++ b/src/output.h
@@ -100,21 +100,24 @@ protected:
public:
format_accounts(report_t& _report,
- const string& _format,
- const string& display_predicate = "",
+ const string& _format = "",
const bool _print_final_total = true)
- : report(_report), format(_format), disp_pred(display_predicate),
+ : report(_report), format(_format), disp_pred(),
print_final_total(_print_final_total)
{
- TRACE_CTOR(format_accounts,
- "report&, const string&, const string&, const bool");
+ TRACE_CTOR(format_accounts, "report&, const string&, const bool");
}
virtual ~format_accounts() {
TRACE_DTOR(format_accounts);
}
- virtual void flush();
+ bool should_display(account_t& account) {
+ if (! disp_pred.predicate)
+ disp_pred.predicate.parse(report.display_predicate);
+ return disp_pred(account);
+ }
+ virtual void flush();
virtual void operator()(account_t& account);
};
@@ -127,8 +130,7 @@ class format_equity : public format_accounts
public:
format_equity(report_t& _report,
- const string& _format,
- const string& display_predicate = "");
+ const string& _format);
virtual ~format_equity() {
TRACE_DTOR(format_equity);
}