diff options
author | John Wiegley <johnw@newartisans.com> | 2009-11-12 14:29:08 -0500 |
---|---|---|
committer | John Wiegley <johnw@newartisans.com> | 2009-11-12 14:29:08 -0500 |
commit | bfd9ecf2af079894f95bac365818c9548f561039 (patch) | |
tree | dce7e13ec7ad8f18bc628efe511d17e94bc3e16d /src/filters.h | |
parent | a034435c4287aba7fd32ed63a745e560350c924a (diff) | |
parent | 49a356f2d260ed0cc071ca1aa82027bd325b0b8b (diff) | |
download | fork-ledger-bfd9ecf2af079894f95bac365818c9548f561039.tar.gz fork-ledger-bfd9ecf2af079894f95bac365818c9548f561039.tar.bz2 fork-ledger-bfd9ecf2af079894f95bac365818c9548f561039.zip |
Merge branch 'next'
Diffstat (limited to 'src/filters.h')
-rw-r--r-- | src/filters.h | 34 |
1 files changed, 32 insertions, 2 deletions
diff --git a/src/filters.h b/src/filters.h index ba3692ac..80bbe5b4 100644 --- a/src/filters.h +++ b/src/filters.h @@ -61,6 +61,35 @@ public: virtual void operator()(post_t&) {} }; +class collect_posts : public item_handler<post_t> +{ +public: + std::vector<post_t *> posts; + + collect_posts() : item_handler<post_t>() { + TRACE_CTOR(collect_posts, ""); + } + virtual ~collect_posts() { + TRACE_DTOR(collect_posts); + } + + std::size_t length() const { + return posts.size(); + } + + std::vector<post_t *>::iterator begin() { + return posts.begin(); + } + std::vector<post_t *>::iterator end() { + return posts.end(); + } + + virtual void flush() {} + virtual void operator()(post_t& post) { + posts.push_back(&post); + } +}; + class posts_iterator; class pass_down_posts : public item_handler<post_t> @@ -550,8 +579,9 @@ class transfer_details : public item_handler<post_t> public: enum element_t { - SET_PAYEE, - SET_ACCOUNT + SET_DATE, + SET_ACCOUNT, + SET_PAYEE } which_element; transfer_details(post_handler_ptr handler, |