summaryrefslogtreecommitdiff
path: root/src/chain.cc
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2009-02-06 03:31:41 -0400
committerJohn Wiegley <johnw@newartisans.com>2009-02-06 03:31:41 -0400
commitcf6babcf9048f7e9205b1bead4794d8e2e9e8d62 (patch)
tree38688d2cd2433517045a67d2ef3f2777ee335050 /src/chain.cc
parentecc5a1aab50d57e65b654ea9f8a84f17208ca612 (diff)
downloadfork-ledger-cf6babcf9048f7e9205b1bead4794d8e2e9e8d62.tar.gz
fork-ledger-cf6babcf9048f7e9205b1bead4794d8e2e9e8d62.tar.bz2
fork-ledger-cf6babcf9048f7e9205b1bead4794d8e2e9e8d62.zip
Restored all the option handlers from 2.6.2, but not the options themselves.
Diffstat (limited to 'src/chain.cc')
-rw-r--r--src/chain.cc31
1 files changed, 16 insertions, 15 deletions
diff --git a/src/chain.cc b/src/chain.cc
index 4956a237..b83c6c8c 100644
--- a/src/chain.cc
+++ b/src/chain.cc
@@ -55,10 +55,10 @@ xact_handler_ptr chain_xact_handlers(report_t& report,
// filter_xacts will only pass through xacts matching the
// `display_predicate'.
- if (! report.display_predicate.empty())
+ if (report.HANDLED(display_))
handler.reset(new filter_xacts
- (handler, item_predicate<xact_t>(report.display_predicate,
- report.what_to_keep)));
+ (handler, item_predicate<xact_t>(report.HANDLER(display_).str(),
+ report.what_to_keep())));
// calc_xacts computes the running total. When this appears will
// determine, for example, whether filtered xacts are included or excluded
@@ -86,7 +86,7 @@ xact_handler_ptr chain_xact_handlers(report_t& report,
i++)
handler.reset(new component_xacts
(handler,
- item_predicate<xact_t>(*i, report.what_to_keep)));
+ item_predicate<xact_t>(*i, report.what_to_keep())));
remember_components = true;
}
@@ -105,10 +105,10 @@ xact_handler_ptr chain_xact_handlers(report_t& report,
// filter_xacts will only pass through xacts matching the
// `secondary_predicate'.
- if (! report.secondary_predicate.empty())
+ if (report.HANDLED(only_))
handler.reset(new filter_xacts
(handler, item_predicate<xact_t>
- (report.secondary_predicate, report.what_to_keep)));
+ (report.HANDLER(only_).str(), report.what_to_keep())));
// sort_xacts will sort all the xacts it sees, based on the `sort_order'
// value expression.
@@ -122,9 +122,10 @@ xact_handler_ptr chain_xact_handlers(report_t& report,
// changed_value_xacts adds virtual xacts to the list to account for
// changes in market value of commodities, which otherwise would affect
// the running total unpredictably.
- if (report.show_revalued)
- handler.reset(new changed_value_xacts(handler, report.total_expr,
- report.show_revalued_only));
+ if (report.HANDLED(revalued))
+ handler.reset(new changed_value_xacts(handler,
+ report.HANDLER(total_).expr,
+ report.HANDLED(revalued_only)));
// collapse_xacts causes entries with multiple xacts to appear as entries
// with a subtotaled xact for each commodity used.
@@ -149,8 +150,8 @@ xact_handler_ptr chain_xact_handlers(report_t& report,
// interval_xacts groups xacts together based on a time period, such as
// weekly or monthly.
- if (! report.report_period.empty()) {
- handler.reset(new interval_xacts(handler, report.report_period,
+ if (report.HANDLED(period_)) {
+ handler.reset(new interval_xacts(handler, report.HANDLER(period_).str(),
remember_components));
handler.reset(new sort_xacts(handler, "d"));
}
@@ -173,12 +174,12 @@ xact_handler_ptr chain_xact_handlers(report_t& report,
handler.reset(new anonymize_xacts(handler));
// This filter_xacts will only pass through xacts matching the `predicate'.
- if (! report.predicate.empty()) {
+ if (report.HANDLED(limit_)) {
DEBUG("report.predicate",
- "Report predicate expression = " << report.predicate);
+ "Report predicate expression = " << report.HANDLER(limit_).str());
handler.reset(new filter_xacts
- (handler, item_predicate<xact_t>(report.predicate,
- report.what_to_keep)));
+ (handler, item_predicate<xact_t>(report.HANDLER(limit_).str(),
+ report.what_to_keep())));
}
#if 0