From 623e6e024cf43fc855c889314b8da8802c2f0449 Mon Sep 17 00:00:00 2001 From: John Wiegley Date: Wed, 9 May 2007 07:43:29 +0000 Subject: Move commodity-related parsing code from amount.cc into commodity.cc. --- src/commodity.h | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'src/commodity.h') 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 value(const optional& moment = optional()); + 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 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); } -- cgit v1.2.3