diff options
author | John Wiegley <johnw@newartisans.com> | 2006-03-16 13:06:59 +0000 |
---|---|---|
committer | John Wiegley <johnw@newartisans.com> | 2008-04-13 02:41:30 -0400 |
commit | 31b68bbebcf448406020a8177efe6ae2f381d5cb (patch) | |
tree | daf3362377958b301ba0892541706cd281f38c57 | |
parent | b1a04923fefdc83387b776b6684188ce2175bfc4 (diff) | |
download | fork-ledger-31b68bbebcf448406020a8177efe6ae2f381d5cb.tar.gz fork-ledger-31b68bbebcf448406020a8177efe6ae2f381d5cb.tar.bz2 fork-ledger-31b68bbebcf448406020a8177efe6ae2f381d5cb.zip |
*** empty log message ***
-rw-r--r-- | amount.cc | 23 | ||||
-rw-r--r-- | amount.h | 23 |
2 files changed, 23 insertions, 23 deletions
@@ -1396,6 +1396,29 @@ amount_t amount_t::strip_annotations(const bool _keep_price, return temp; } +amount_t amount_t::price() const +{ + if (commodity_ && commodity_->annotated) { + amount_t temp(((annotated_commodity_t *)commodity_)->price); + temp *= *this; + DEBUG_PRINT("amounts.commodities", + "Returning price of " << *this << " = " << temp); + return temp; + } + return *this; +} + +std::time_t amount_t::date() const +{ + if (commodity_ && commodity_->annotated) { + DEBUG_PRINT("amounts.commodities", + "Returning date of " << *this << " = " + << ((annotated_commodity_t *)commodity_)->date); + return ((annotated_commodity_t *)commodity_)->date; + } + return 0L; +} + void commodity_base_t::add_price(const std::time_t date, const amount_t& price) { @@ -595,29 +595,6 @@ inline commodity_t& amount_t::commodity() const { return *commodity_; } -inline amount_t amount_t::price() const { - if (commodity_ && commodity_->annotated) { - amount_t temp(((annotated_commodity_t *)commodity_)->price); - temp *= *this; - DEBUG_PRINT("amounts.commodities", - "Returning price of " << *this << " = " << temp); - return temp; - } else { - return 0L; - } -} - -inline std::time_t amount_t::date() const { - if (commodity_ && commodity_->annotated) { - DEBUG_PRINT("amounts.commodities", - "Returning date of " << *this << " = " - << ((annotated_commodity_t *)commodity_)->date); - return ((annotated_commodity_t *)commodity_)->date; - } else { - return 0L; - } -} - class amount_error : public error { public: amount_error(const std::string& reason) throw() : error(reason) {} |