summaryrefslogtreecommitdiff
path: root/src/chain.cc
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2010-06-11 16:03:50 -0400
committerJohn Wiegley <johnw@newartisans.com>2010-06-11 17:02:25 -0400
commitdea2aed0b509734ec4e1cd163ac2a4f013000da2 (patch)
tree7908da76c67ae5172882306a319bf26df81b73b4 /src/chain.cc
parentd580079df892c30d023b3211d6c4611c17b11f8f (diff)
downloadfork-ledger-dea2aed0b509734ec4e1cd163ac2a4f013000da2.tar.gz
fork-ledger-dea2aed0b509734ec4e1cd163ac2a4f013000da2.tar.bz2
fork-ledger-dea2aed0b509734ec4e1cd163ac2a4f013000da2.zip
Untabified all source files
Diffstat (limited to 'src/chain.cc')
-rw-r--r--src/chain.cc118
1 files changed, 59 insertions, 59 deletions
diff --git a/src/chain.cc b/src/chain.cc
index 9a74cdca..49e0e470 100644
--- a/src/chain.cc
+++ b/src/chain.cc
@@ -40,7 +40,7 @@
namespace ledger {
post_handler_ptr chain_pre_post_handlers(post_handler_ptr base_handler,
- report_t& report)
+ report_t& report)
{
post_handler_ptr handler(base_handler);
@@ -52,11 +52,11 @@ post_handler_ptr chain_pre_post_handlers(post_handler_ptr base_handler,
// This filter_posts will only pass through posts matching the `predicate'.
if (report.HANDLED(limit_)) {
DEBUG("report.predicate",
- "Report predicate expression = " << report.HANDLER(limit_).str());
+ "Report predicate expression = " << report.HANDLER(limit_).str());
handler.reset(new filter_posts
- (handler, predicate_t(report.HANDLER(limit_).str(),
- report.what_to_keep()),
- report));
+ (handler, predicate_t(report.HANDLER(limit_).str(),
+ report.what_to_keep()),
+ report));
}
// budget_posts takes a set of posts from a data file and uses them to
@@ -68,7 +68,7 @@ post_handler_ptr chain_pre_post_handlers(post_handler_ptr base_handler,
if (report.budget_flags != BUDGET_NO_BUDGET) {
budget_posts * budget_handler = new budget_posts(handler,
- report.budget_flags);
+ report.budget_flags);
budget_handler->add_period_xacts(report.session.journal->period_xacts);
handler.reset(budget_handler);
@@ -78,41 +78,41 @@ post_handler_ptr chain_pre_post_handlers(post_handler_ptr base_handler,
// the filter get reported.
if (report.HANDLED(limit_))
handler.reset(new filter_posts
- (handler, predicate_t(report.HANDLER(limit_).str(),
- report.what_to_keep()),
- report));
+ (handler, predicate_t(report.HANDLER(limit_).str(),
+ report.what_to_keep()),
+ report));
}
else if (report.HANDLED(forecast_while_)) {
forecast_posts * forecast_handler
= new forecast_posts(handler,
- predicate_t(report.HANDLER(forecast_while_).str(),
- report.what_to_keep()),
- report,
- report.HANDLED(forecast_years_) ?
- static_cast<std::size_t>
- (report.HANDLER(forecast_years_).value.to_long()) :
- 5UL);
+ predicate_t(report.HANDLER(forecast_while_).str(),
+ report.what_to_keep()),
+ report,
+ report.HANDLED(forecast_years_) ?
+ static_cast<std::size_t>
+ (report.HANDLER(forecast_years_).value.to_long()) :
+ 5UL);
forecast_handler->add_period_xacts(report.session.journal->period_xacts);
handler.reset(forecast_handler);
// See above, under budget_posts.
if (report.HANDLED(limit_))
handler.reset(new filter_posts
- (handler, predicate_t(report.HANDLER(limit_).str(),
- report.what_to_keep()),
- report));
+ (handler, predicate_t(report.HANDLER(limit_).str(),
+ report.what_to_keep()),
+ report));
}
return handler;
}
post_handler_ptr chain_post_handlers(post_handler_ptr base_handler,
- report_t& report,
- bool for_accounts_report)
+ report_t& report,
+ bool for_accounts_report)
{
- post_handler_ptr handler(base_handler);
- predicate_t display_predicate;
- predicate_t only_predicate;
+ post_handler_ptr handler(base_handler);
+ predicate_t display_predicate;
+ predicate_t only_predicate;
display_filter_posts * display_filter = NULL;
assert(report.HANDLED(amount_));
@@ -123,34 +123,34 @@ post_handler_ptr chain_post_handlers(post_handler_ptr base_handler,
// Make sure only forecast postings which match are allowed through
if (report.HANDLED(forecast_while_)) {
handler.reset(new filter_posts
- (handler, predicate_t(report.HANDLER(forecast_while_).str(),
- report.what_to_keep()),
- report));
+ (handler, predicate_t(report.HANDLER(forecast_while_).str(),
+ report.what_to_keep()),
+ report));
}
// truncate_xacts cuts off a certain number of _xacts_ from being
// displayed. It does not affect calculation.
if (report.HANDLED(head_) || report.HANDLED(tail_))
handler.reset
- (new truncate_xacts(handler,
- report.HANDLED(head_) ?
- report.HANDLER(head_).value.to_int() : 0,
- report.HANDLED(tail_) ?
- report.HANDLER(tail_).value.to_int() : 0));
+ (new truncate_xacts(handler,
+ report.HANDLED(head_) ?
+ report.HANDLER(head_).value.to_int() : 0,
+ report.HANDLED(tail_) ?
+ report.HANDLER(tail_).value.to_int() : 0));
// changed_value_posts adds virtual posts to the list to account for changes
// in market value of commodities, which otherwise would affect the running
// total unpredictably.
display_filter = new display_filter_posts(handler, report,
- report.HANDLED(revalued) &&
- ! report.HANDLED(no_rounding));
+ report.HANDLED(revalued) &&
+ ! report.HANDLED(no_rounding));
handler.reset(display_filter);
// filter_posts will only pass through posts matching the
// `display_predicate'.
if (report.HANDLED(display_)) {
display_predicate = predicate_t(report.HANDLER(display_).str(),
- report.what_to_keep());
+ report.what_to_keep());
handler.reset(new filter_posts(handler, display_predicate, report));
}
}
@@ -161,21 +161,21 @@ post_handler_ptr chain_post_handlers(post_handler_ptr base_handler,
if (report.HANDLED(revalued) &&
(! for_accounts_report || report.HANDLED(unrealized)))
handler.reset(new changed_value_posts(handler, report, for_accounts_report,
- report.HANDLED(unrealized),
- display_filter));
+ report.HANDLED(unrealized),
+ display_filter));
// calc_posts computes the running total. When this appears will determine,
// for example, whether filtered posts are included or excluded from the
// running total.
handler.reset(new calc_posts(handler, expr, (! for_accounts_report ||
- (report.HANDLED(revalued) &&
- report.HANDLED(unrealized)))));
+ (report.HANDLED(revalued) &&
+ report.HANDLED(unrealized)))));
// filter_posts will only pass through posts matching the
// `secondary_predicate'.
if (report.HANDLED(only_)) {
only_predicate = predicate_t(report.HANDLER(only_).str(),
- report.what_to_keep());
+ report.what_to_keep());
handler.reset(new filter_posts(handler, only_predicate, report));
}
@@ -184,13 +184,13 @@ post_handler_ptr chain_post_handlers(post_handler_ptr base_handler,
// value expression.
if (report.HANDLED(sort_)) {
if (report.HANDLED(sort_xacts_))
- handler.reset(new sort_xacts(handler, report.HANDLER(sort_).str()));
+ handler.reset(new sort_xacts(handler, report.HANDLER(sort_).str()));
else
- handler.reset(new sort_posts(handler, report.HANDLER(sort_).str()));
+ handler.reset(new sort_posts(handler, report.HANDLER(sort_).str()));
}
#if 0
else if (! report.HANDLED(period_) &&
- ! report.HANDLED(unsorted)) {
+ ! report.HANDLED(unsorted)) {
handler.reset(new sort_posts(handler, "date"));
}
#endif
@@ -199,8 +199,8 @@ post_handler_ptr chain_post_handlers(post_handler_ptr base_handler,
// with a subtotaled post for each commodity used.
if (report.HANDLED(collapse))
handler.reset(new collapse_posts(handler, report, expr,
- display_predicate, only_predicate,
- report.HANDLED(collapse_if_zero)));
+ display_predicate, only_predicate,
+ report.HANDLED(collapse_if_zero)));
// subtotal_posts combines all the posts it receives into one subtotal
// xact, which has one post for each commodity in each account.
@@ -225,37 +225,37 @@ post_handler_ptr chain_post_handlers(post_handler_ptr base_handler,
// weekly or monthly.
if (report.HANDLED(period_)) {
handler.reset(new interval_posts(handler, expr,
- report.HANDLER(period_).str(),
- report.HANDLED(exact),
- report.HANDLED(empty)));
+ report.HANDLER(period_).str(),
+ report.HANDLED(exact),
+ report.HANDLED(empty)));
handler.reset(new sort_posts(handler, "date"));
}
if (report.HANDLED(date_))
handler.reset(new transfer_details(handler, transfer_details::SET_DATE,
- report.session.journal->master,
- report.HANDLER(date_).str(),
- report));
+ report.session.journal->master,
+ report.HANDLER(date_).str(),
+ report));
if (report.HANDLED(account_)) {
handler.reset(new transfer_details(handler, transfer_details::SET_ACCOUNT,
- report.session.journal->master,
- report.HANDLER(account_).str(),
- report));
+ report.session.journal->master,
+ report.HANDLER(account_).str(),
+ report));
}
else if (report.HANDLED(pivot_)) {
string pivot = report.HANDLER(pivot_).str();
pivot = string("\"") + pivot + ":\" + tag(\"" + pivot + "\")";
handler.reset(new transfer_details(handler, transfer_details::SET_ACCOUNT,
- report.session.journal->master, pivot,
- report));
+ report.session.journal->master, pivot,
+ report));
}
if (report.HANDLED(payee_))
handler.reset(new transfer_details(handler, transfer_details::SET_PAYEE,
- report.session.journal->master,
- report.HANDLER(payee_).str(),
- report));
+ report.session.journal->master,
+ report.HANDLER(payee_).str(),
+ report));
// related_posts will pass along all posts related to the post received. If
// the `related_all' handler is on, then all the xact's posts are passed;