diff options
author | Johann Klähn <kljohann@gmail.com> | 2013-03-08 21:45:56 +0100 |
---|---|---|
committer | Johann Klähn <kljohann@gmail.com> | 2013-03-08 22:56:01 +0100 |
commit | a875940a93848d4b18b5bed45049edc901ad07a2 (patch) | |
tree | 33dcb08c5cb43ada33c4c4af9b11cb7c0bf6b3ef /src/amount.cc | |
parent | 8f4b0e89627b082f9c5d4bd2b506661aab732b0b (diff) | |
download | fork-ledger-a875940a93848d4b18b5bed45049edc901ad07a2.tar.gz fork-ledger-a875940a93848d4b18b5bed45049edc901ad07a2.tar.bz2 fork-ledger-a875940a93848d4b18b5bed45049edc901ad07a2.zip |
fix ledger xml output, remove ledger json command
As the format used by property trees to represent valid JSON
and that for valid XML is too different and given that there are
more requests for valid XML output I decided to pursue a quick fix
and remove the json command in favor of a working xml command.
See bug #782, #909, recent discussion on mailing list.
JSON support is postponed until I or someone else finds time to work on
this or the python bindings are more stable.
Diffstat (limited to 'src/amount.cc')
-rw-r--r-- | src/amount.cc | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/src/amount.cc b/src/amount.cc index 88f2d124..55cbabeb 100644 --- a/src/amount.cc +++ b/src/amount.cc @@ -1320,13 +1320,11 @@ bool amount_t::valid() const return true; } -void put_amount(property_tree::ptree& pt, const amount_t& amt, - bool wrap, bool commodity_details) +void put_amount(property_tree::ptree& st, const amount_t& amt, + bool commodity_details) { - property_tree::ptree& st(wrap ? pt.put("amount", "") : pt); - if (amt.has_commodity()) - put_commodity(st, amt.commodity(), commodity_details); + put_commodity(st.put("commodity", ""), amt.commodity(), commodity_details); st.put("quantity", amt.quantity_string()); } |