summaryrefslogtreecommitdiff
path: root/src/filters.h
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2010-06-09 07:38:45 -0400
committerJohn Wiegley <johnw@newartisans.com>2010-06-09 07:47:45 -0400
commitc28fad384c28fb929fc8ea69854496141bdf306a (patch)
tree9b4d0197448cd8587e11f5e3e65214e9dc80e3a7 /src/filters.h
parent8637dd6ccf7afc71d911cd66c4a55a1308596dbb (diff)
downloadfork-ledger-c28fad384c28fb929fc8ea69854496141bdf306a.tar.gz
fork-ledger-c28fad384c28fb929fc8ea69854496141bdf306a.tar.bz2
fork-ledger-c28fad384c28fb929fc8ea69854496141bdf306a.zip
The --anon option now anonymizes commodities
Fixes #227 / 1C90D8AF-830E-43C2-A5B7-D382F68EBDE3
Diffstat (limited to 'src/filters.h')
-rw-r--r--src/filters.h12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/filters.h b/src/filters.h
index 3f2f2145..ffca9d1e 100644
--- a/src/filters.h
+++ b/src/filters.h
@@ -334,20 +334,26 @@ public:
class anonymize_posts : public item_handler<post_t>
{
- temporaries_t temps;
- xact_t * last_xact;
+ typedef std::map<commodity_t *, std::size_t> commodity_index_map;
+
+ temporaries_t temps;
+ commodity_index_map comms;
+ std::size_t next_comm_id;
+ xact_t * last_xact;
anonymize_posts();
public:
anonymize_posts(post_handler_ptr handler)
- : item_handler<post_t>(handler), last_xact(NULL) {
+ : item_handler<post_t>(handler), next_comm_id(0), last_xact(NULL) {
TRACE_CTOR(anonymize_posts, "post_handler_ptr");
}
virtual ~anonymize_posts() {
TRACE_DTOR(anonymize_posts);
}
+ void render_commodity(amount_t& amt);
+
virtual void operator()(post_t& post);
virtual void clear() {