diff options
author | John Wiegley <johnw@newartisans.com> | 2007-05-09 07:43:29 +0000 |
---|---|---|
committer | John Wiegley <johnw@newartisans.com> | 2008-04-13 03:38:42 -0400 |
commit | 623e6e024cf43fc855c889314b8da8802c2f0449 (patch) | |
tree | ed00d4a4c36146ed9a2ff9db503777a0edd4c842 /src/commodity.h | |
parent | 42d799a1fdde6278fe42be58786937e49fcf1c3f (diff) | |
download | fork-ledger-623e6e024cf43fc855c889314b8da8802c2f0449.tar.gz fork-ledger-623e6e024cf43fc855c889314b8da8802c2f0449.tar.bz2 fork-ledger-623e6e024cf43fc855c889314b8da8802c2f0449.zip |
Move commodity-related parsing code from amount.cc into commodity.cc.
Diffstat (limited to 'src/commodity.h')
-rw-r--r-- | src/commodity.h | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/commodity.h b/src/commodity.h index f6e888f3..6551d3b5 100644 --- a/src/commodity.h +++ b/src/commodity.h @@ -190,10 +190,21 @@ public: optional<amount_t> value(const optional<moment_t>& moment = optional<moment_t>()); + static void parse_symbol(std::istream& in, string& symbol); + static string parse_symbol(std::istream& in) { + string temp; + parse_symbol(in, temp); + return temp; + } + void print(std::ostream& out) const { out << symbol(); } + void read(std::istream& in); + void read(char *& data); + void write(std::ostream& out) const; + bool valid() const; }; @@ -224,6 +235,7 @@ struct annotation_t : public equality_comparable<annotation_t> tag == rhs.tag); } + void parse(std::istream& in); void print(std::ostream& out) const { out << "price " << (price ? price->to_string() : "NONE") << " " << "date " << (date ? *date : moment_t()) << " " @@ -273,6 +285,10 @@ public: return *ptr; } + commodity_t& strip_annotations(const bool _keep_price, + const bool _keep_date, + const bool _keep_tag); + void write_annotations(std::ostream& out) const { annotated_commodity_t::write_annotations(out, details); } |