summaryrefslogtreecommitdiff
path: root/src/filters.h
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2009-03-03 17:08:11 -0400
committerJohn Wiegley <johnw@newartisans.com>2009-03-03 17:08:11 -0400
commiteb45a0a4f46577c6615695256e5f6866a27ef20e (patch)
tree7839ad1f692df20276921ec182a78a14b13c61b9 /src/filters.h
parentcf2548c29cbd10c41bd23d119394489e1ced8e2a (diff)
downloadfork-ledger-eb45a0a4f46577c6615695256e5f6866a27ef20e.tar.gz
fork-ledger-eb45a0a4f46577c6615695256e5f6866a27ef20e.tar.bz2
fork-ledger-eb45a0a4f46577c6615695256e5f6866a27ef20e.zip
Normalized how account totals are calculated
Diffstat (limited to 'src/filters.h')
-rw-r--r--src/filters.h26
1 files changed, 6 insertions, 20 deletions
diff --git a/src/filters.h b/src/filters.h
index 64b688ec..aafdf082 100644
--- a/src/filters.h
+++ b/src/filters.h
@@ -185,22 +185,6 @@ public:
*
* Long.
*/
-class set_account_value : public item_handler<post_t>
-{
- expr_t& amount_expr;
-
-public:
- set_account_value(expr_t& _amount_expr)
- : item_handler<post_t>(), amount_expr(_amount_expr) {}
-
- virtual void operator()(post_t& post);
-};
-
-/**
- * @brief Brief
- *
- * Long.
- */
class sort_posts : public item_handler<post_t>
{
typedef std::deque<post_t *> posts_deque;
@@ -359,15 +343,17 @@ class calc_posts : public item_handler<post_t>
{
post_t * last_post;
expr_t& amount_expr;
+ bool calc_totals;
calc_posts();
public:
calc_posts(post_handler_ptr handler,
- expr_t& _amount_expr)
- : item_handler<post_t>(handler),
- last_post(NULL), amount_expr(_amount_expr) {
- TRACE_CTOR(calc_posts, "post_handler_ptr, expr_t&");
+ expr_t& _amount_expr,
+ bool _calc_totals = false)
+ : item_handler<post_t>(handler), last_post(NULL),
+ amount_expr(_amount_expr), calc_totals(_calc_totals) {
+ TRACE_CTOR(calc_posts, "post_handler_ptr, expr_t&, bool");
}
virtual ~calc_posts() {
TRACE_DTOR(calc_posts);