From a38ed141c1f33ecdad99b322acb1ae07b30a5da2 Mon Sep 17 00:00:00 2001 From: John Wiegley Date: Fri, 18 May 2012 01:31:01 -0600 Subject: Switched to Boost.PropertyTree for XML generation --- src/amount.cc | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) (limited to 'src/amount.cc') 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) -- cgit v1.2.3