diff options
author | John Wiegley <johnw@newartisans.com> | 2009-02-01 22:10:32 -0400 |
---|---|---|
committer | John Wiegley <johnw@newartisans.com> | 2009-02-01 22:10:32 -0400 |
commit | fb5428ce85127413da6cba184dda178352a82b3c (patch) | |
tree | e72d931ec737a7442a61bdfc3a61379a3fa8de48 /src/item.h | |
parent | 7128fdb6373c901c9c68e2d8ddac911891466c40 (diff) | |
download | fork-ledger-fb5428ce85127413da6cba184dda178352a82b3c.tar.gz fork-ledger-fb5428ce85127413da6cba184dda178352a82b3c.tar.bz2 fork-ledger-fb5428ce85127413da6cba184dda178352a82b3c.zip |
Added support for metadata and tagging, and made regexs a first-class type.
Diffstat (limited to 'src/item.h')
-rw-r--r-- | src/item.h | 18 |
1 files changed, 18 insertions, 0 deletions
@@ -72,6 +72,9 @@ public: optional<date_t> _date_eff; optional<string> note; + typedef std::map<string, optional<string> > string_map; + optional<string_map> metadata; + unsigned short src_idx; istream_pos_type full_beg_pos; std::size_t full_beg_line; @@ -122,6 +125,19 @@ public: return ! (*this == entry); } + virtual bool has_tag(const string& tag) const; + virtual optional<string> get_tag(const string& tag) const; + virtual void set_tag(const string& tag, + const optional<string>& value = none); + virtual void parse_tags(const char * p); + + virtual void append_note(const char * p) { + if (note) + *note += p; + else + note = p; + } + virtual optional<date_t> actual_date() const { return _date; } @@ -147,6 +163,8 @@ public: bool valid() const; }; +value_t get_comment(item_t& item); + } // namespace ledger #endif // _ITEM_H |