diff options
author | John Wiegley <johnw@newartisans.com> | 2007-04-30 12:20:58 +0000 |
---|---|---|
committer | John Wiegley <johnw@newartisans.com> | 2008-04-13 03:38:34 -0400 |
commit | 18aaf588ab55dfef5556e27ab69491f4c77ad303 (patch) | |
tree | 2a0d2d3afb537d93f23085f0b9cbe6b9cf8562a4 /src/balance.h | |
parent | 21af83013f3b1bae511a61b9e27224ab3de235c1 (diff) | |
download | fork-ledger-18aaf588ab55dfef5556e27ab69491f4c77ad303.tar.gz fork-ledger-18aaf588ab55dfef5556e27ab69491f4c77ad303.tar.bz2 fork-ledger-18aaf588ab55dfef5556e27ab69491f4c77ad303.zip |
Added use of boost::optional<> to amount.h
Diffstat (limited to 'src/balance.h')
-rw-r--r-- | src/balance.h | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/src/balance.h b/src/balance.h index 2a6f3072..e8665335 100644 --- a/src/balance.h +++ b/src/balance.h @@ -435,8 +435,10 @@ class balance_t amount_t amount(const commodity_t& commodity = *commodity_t::null_commodity) const; balance_t value(const moment_t& moment = now) const; - balance_t price() const; - moment_t date() const; + + optional<balance_t> price() const; + optional<moment_t> date() const; + optional<string> tag() const; balance_t strip_annotations(const bool keep_price = amount_t::keep_price, @@ -896,12 +898,16 @@ class balance_pair_t balance_t value(const moment_t& moment = now) const { return quantity.value(moment); } - balance_t price() const { + + optional<balance_t> price() const { return quantity.price(); } - moment_t date() const { + optional<moment_t> date() const { return quantity.date(); } + optional<string> tag() const { + return quantity.tag(); + } balance_t strip_annotations(const bool keep_price = amount_t::keep_price, |