summaryrefslogtreecommitdiff
path: root/src/output.h
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2009-02-17 04:49:10 -0400
committerJohn Wiegley <johnw@newartisans.com>2009-02-17 04:49:10 -0400
commitce8442a30dc3bb2fb52ec250028b46354d17cbca (patch)
tree837acb6d1a229c62b721f31f88d827f709c4a798 /src/output.h
parent7dc6e6f109ae2f48ad6253888f8065f6a0af1e43 (diff)
downloadfork-ledger-ce8442a30dc3bb2fb52ec250028b46354d17cbca.tar.gz
fork-ledger-ce8442a30dc3bb2fb52ec250028b46354d17cbca.tar.bz2
fork-ledger-ce8442a30dc3bb2fb52ec250028b46354d17cbca.zip
Rewrote how the balance command displays accounts
The previous method bent over backwards to try and avoid multiple passes through the account tree, but the result was a horribly complicated mess that never ceased to dredge up obscure bugs. The new scheme is a very, very simple two-pass algorithm, with multiple subpasses during the second pass for refining the output based on the report options.
Diffstat (limited to 'src/output.h')
-rw-r--r--src/output.h15
1 files changed, 9 insertions, 6 deletions
diff --git a/src/output.h b/src/output.h
index d62a77b1..6952a4a5 100644
--- a/src/output.h
+++ b/src/output.h
@@ -165,9 +165,6 @@ protected:
item_predicate disp_pred;
bool print_final_total;
- bool disp_subaccounts_p(account_t& account, account_t *& to_show);
- bool display_account(account_t& account);
-
public:
format_accounts(report_t& _report,
const string& _format = "",
@@ -176,14 +173,20 @@ public:
print_final_total(_print_final_total)
{
TRACE_CTOR(format_accounts, "report&, const string&, const bool");
+
+ if (report.HANDLED(display_)) {
+ DEBUG("account.display",
+ "Account display predicate: " << report.HANDLER(display_).str());
+ disp_pred.predicate.parse(report.HANDLER(display_).str());
+ }
}
virtual ~format_accounts() {
TRACE_DTOR(format_accounts);
}
- bool should_display(account_t& account);
-
+ virtual void post_accounts(account_t& account);
virtual void flush();
+
virtual void operator()(account_t& account);
};
@@ -207,7 +210,7 @@ class format_equity : public format_accounts
}
virtual void flush();
- virtual void operator()(account_t& account);
+ virtual void post_accounts(account_t& account);
};
} // namespace ledger