diff options
author | Craig Earls <enderw88@gmail.com> | 2013-01-29 09:42:10 -0700 |
---|---|---|
committer | Craig Earls <enderw88@gmail.com> | 2013-01-29 09:42:10 -0700 |
commit | 3e72a51dc3d296c9f647efaf4cbfbbdcf4bf6df1 (patch) | |
tree | 2d83e5a8d6a864ada5d9a948d322ca5254fe5e6d /src/output.h | |
parent | 5d1971ee51a18f927185d20fb0a4426d8f08aa86 (diff) | |
download | fork-ledger-3e72a51dc3d296c9f647efaf4cbfbbdcf4bf6df1.tar.gz fork-ledger-3e72a51dc3d296c9f647efaf4cbfbbdcf4bf6df1.tar.bz2 fork-ledger-3e72a51dc3d296c9f647efaf4cbfbbdcf4bf6df1.zip |
Addes tags command and --values option
Tags command reports all metadat tags in use. With the
values option it reports tags and their values.
Diffstat (limited to 'src/output.h')
-rw-r--r-- | src/output.h | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/src/output.h b/src/output.h index 281f69b6..9895cb44 100644 --- a/src/output.h +++ b/src/output.h @@ -189,6 +189,33 @@ public: } }; +class report_tags : public item_handler<post_t> +{ +protected: + report_t& report; + + std::map<string, std::size_t> tags; + + typedef std::map<string, std::size_t>::value_type tags_pair; + +public: + report_tags(report_t& _report) : report(_report) { + TRACE_CTOR(report_tags, "report&"); + } + virtual ~report_tags() { + TRACE_DTOR(report_tags); + } + + virtual void flush(); + virtual void operator()(post_t& post); + + virtual void clear() { + tags.clear(); + item_handler<post_t>::clear(); + } +}; + + class report_commodities : public item_handler<post_t> { protected: |