diff options
author | John Wiegley <johnw@newartisans.com> | 2012-05-18 01:31:01 -0600 |
---|---|---|
committer | John Wiegley <johnw@newartisans.com> | 2012-05-18 01:31:01 -0600 |
commit | a38ed141c1f33ecdad99b322acb1ae07b30a5da2 (patch) | |
tree | c6555946e2575a6bcb0ae7642673257954e38ac1 /src/amount.cc | |
parent | 3c3bda19d62eed165b9191dbf1adcb3e7c975356 (diff) | |
download | fork-ledger-a38ed141c1f33ecdad99b322acb1ae07b30a5da2.tar.gz fork-ledger-a38ed141c1f33ecdad99b322acb1ae07b30a5da2.tar.bz2 fork-ledger-a38ed141c1f33ecdad99b322acb1ae07b30a5da2.zip |
Switched to Boost.PropertyTree for XML generation
Diffstat (limited to 'src/amount.cc')
-rw-r--r-- | src/amount.cc | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/src/amount.cc b/src/amount.cc index 803787e8..645b244b 100644 --- a/src/amount.cc +++ b/src/amount.cc @@ -1283,17 +1283,15 @@ bool amount_t::valid() const return true; } -void to_xml(std::ostream& out, const amount_t& amt, bool commodity_details) +void put_amount(property_tree::ptree& pt, const amount_t& amt, + bool wrap, bool commodity_details) { - push_xml x(out, "amount"); + property_tree::ptree& st(wrap ? pt.put("amount", "") : pt); if (amt.has_commodity()) - to_xml(out, amt.commodity(), commodity_details); + put_commodity(st, amt.commodity(), commodity_details); - { - push_xml y(out, "quantity"); - out << y.guard(amt.quantity_string()); - } + st.put("quantity", amt.quantity_string()); } #if defined(HAVE_BOOST_SERIALIZATION) |