summaryrefslogtreecommitdiff
path: root/src/commodity.h
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2009-02-24 03:40:57 -0400
committerJohn Wiegley <johnw@newartisans.com>2009-02-24 03:40:57 -0400
commit79c74782783f789c067d3ba1fb1461c436b07828 (patch)
treea2a2fc8f7888c0c973edf0d2d1d6c42ef5f96056 /src/commodity.h
parenteb364f4183d2549540c92d3e58246fad4f45dda2 (diff)
downloadfork-ledger-79c74782783f789c067d3ba1fb1461c436b07828.tar.gz
fork-ledger-79c74782783f789c067d3ba1fb1461c436b07828.tar.bz2
fork-ledger-79c74782783f789c067d3ba1fb1461c436b07828.zip
Fixes to the way annotated prices are displayed
Diffstat (limited to 'src/commodity.h')
-rw-r--r--src/commodity.h17
1 files changed, 5 insertions, 12 deletions
diff --git a/src/commodity.h b/src/commodity.h
index d2c778c2..93b5bf1d 100644
--- a/src/commodity.h
+++ b/src/commodity.h
@@ -391,11 +391,8 @@ struct annotation_t : public equality_comparable<annotation_t>
}
void parse(std::istream& in);
- void print(std::ostream& out) const {
- out << "price " << (price ? price->to_string() : "NONE") << " "
- << "date " << (date ? *date : date_t()) << " "
- << "tag " << (tag ? *tag : "NONE");
- }
+
+ void print(std::ostream& out, bool keep_base = false) const;
bool valid() const {
assert(*this);
@@ -486,13 +483,7 @@ public:
}
virtual commodity_t& strip_annotations(const keep_details_t& what_to_keep);
-
- virtual void write_annotations(std::ostream& out) const {
- annotated_commodity_t::write_annotations(out, details);
- }
-
- static void write_annotations(std::ostream& out,
- const annotation_t& info);
+ virtual void write_annotations(std::ostream& out) const;
};
inline annotated_commodity_t&
@@ -535,6 +526,8 @@ public:
commodity_t * null_commodity;
commodity_t * default_commodity;
+ bool keep_base;
+
public:
boost::function<optional<amount_t>
(commodity_t& commodity,