summaryrefslogtreecommitdiff
path: root/src/commodity.cc
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2009-02-22 17:51:11 -0400
committerJohn Wiegley <johnw@newartisans.com>2009-02-22 17:51:11 -0400
commitea75613760440604ba5bdc2ab7f89892dc28c079 (patch)
treec6cd3ec4871f9598dfe2191f0cb7e2933da8b920 /src/commodity.cc
parentf2e4f4c6d1f20949232ab776cb24bfbd2db2797b (diff)
downloadfork-ledger-ea75613760440604ba5bdc2ab7f89892dc28c079.tar.gz
fork-ledger-ea75613760440604ba5bdc2ab7f89892dc28c079.tar.bz2
fork-ledger-ea75613760440604ba5bdc2ab7f89892dc28c079.zip
--exchange option now accepts multiple commodities
They must be separated by a comma, and all whitespace is ignored.
Diffstat (limited to 'src/commodity.cc')
-rw-r--r--src/commodity.cc39
1 files changed, 0 insertions, 39 deletions
diff --git a/src/commodity.cc b/src/commodity.cc
index 57e20891..f758d3b4 100644
--- a/src/commodity.cc
+++ b/src/commodity.cc
@@ -352,29 +352,6 @@ optional<price_point_t>
return none;
}
-optional<price_point_t>
- commodity_t::base_t::varied_history_t::
- find_price(const commodity_t& source,
- const std::vector<commodity_t *>& commodities,
- const optional<datetime_t>& moment,
- const optional<datetime_t>& oldest
-#if defined(DEBUG_ON)
- , const int indent
-#endif
- ) const
-{
- foreach (commodity_t * commodity, commodities) {
- if (optional<price_point_t> point = find_price(source, *commodity,
- moment, oldest
-#if defined(DEBUG_ON)
- , indent
-#endif
- ))
- return point;
- }
- return none;
-}
-
optional<commodity_t::base_t::history_t&>
commodity_t::base_t::varied_history_t::
history(const optional<commodity_t&>& commodity)
@@ -400,22 +377,6 @@ optional<commodity_t::base_t::history_t&>
return none;
}
-optional<commodity_t::history_t&>
-commodity_t::base_t::varied_history_t::history
- (const std::vector<commodity_t *>& commodities)
-{
- // This function differs from the single commodity case avoid in that
- // 'commodities' represents a list of preferred valuation commodities.
- // If no price can be located in terms of the first commodity, then
- // the second is chosen, etc.
-
- foreach (commodity_t * commodity, commodities) {
- if (optional<history_t&> hist = history(*commodity))
- return hist;
- }
- return none;
-}
-
void commodity_t::exchange(commodity_t& commodity,
const amount_t& per_unit_cost,
const datetime_t& moment)