summaryrefslogtreecommitdiff
path: root/src/value.cc
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2009-02-07 22:50:19 -0400
committerJohn Wiegley <johnw@newartisans.com>2009-02-07 22:50:19 -0400
commitb662509ee95434702c0a0d1cf97f1c1295f06ec4 (patch)
treecc292d70fcf7f05365d80a6400b69f8139c9eeb0 /src/value.cc
parentcb0faac58dde384e817d671c49d250e5beda07c9 (diff)
downloadledger-b662509ee95434702c0a0d1cf97f1c1295f06ec4.tar.gz
ledger-b662509ee95434702c0a0d1cf97f1c1295f06ec4.tar.bz2
ledger-b662509ee95434702c0a0d1cf97f1c1295f06ec4.zip
amount_t::in_place_* now returns void. Added value_t::unreduce.
Diffstat (limited to 'src/value.cc')
-rw-r--r--src/value.cc19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/value.cc b/src/value.cc
index 4b9f5756..4cfee747 100644
--- a/src/value.cc
+++ b/src/value.cc
@@ -1404,6 +1404,25 @@ void value_t::in_place_reduce()
//throw_(value_error, "Cannot reduce " << label());
}
+void value_t::in_place_unreduce()
+{
+ switch (type()) {
+ case AMOUNT:
+ as_amount_lval().in_place_unreduce();
+ return;
+ case BALANCE:
+ as_balance_lval().in_place_unreduce();
+ return;
+ case BALANCE_PAIR:
+ as_balance_pair_lval().in_place_unreduce();
+ return;
+ default:
+ return;
+ }
+
+ //throw_(value_error, "Cannot reduce " << label());
+}
+
value_t value_t::abs() const
{
switch (type()) {