summaryrefslogtreecommitdiff
path: root/src/commodity.cc
diff options
context:
space:
mode:
authorJohann Klähn <kljohann@gmail.com>2013-03-08 21:45:56 +0100
committerJohann Klähn <kljohann@gmail.com>2013-03-08 22:56:01 +0100
commita875940a93848d4b18b5bed45049edc901ad07a2 (patch)
tree33dcb08c5cb43ada33c4c4af9b11cb7c0bf6b3ef /src/commodity.cc
parent8f4b0e89627b082f9c5d4bd2b506661aab732b0b (diff)
downloadfork-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/commodity.cc')
-rw-r--r--src/commodity.cc6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/commodity.cc b/src/commodity.cc
index c7a893f1..535b31c9 100644
--- a/src/commodity.cc
+++ b/src/commodity.cc
@@ -497,11 +497,9 @@ bool commodity_t::compare_by_commodity::operator()(const amount_t * left,
}
}
-void put_commodity(property_tree::ptree& pt, const commodity_t& comm,
+void put_commodity(property_tree::ptree& st, const commodity_t& comm,
bool commodity_details)
{
- property_tree::ptree& st(pt.put("commodity", ""));
-
std::string flags;
if (! (comm.has_flags(COMMODITY_STYLE_SUFFIXED))) flags += 'P';
if (comm.has_flags(COMMODITY_STYLE_SEPARATED)) flags += 'S';
@@ -512,7 +510,7 @@ void put_commodity(property_tree::ptree& pt, const commodity_t& comm,
st.put("symbol", comm.symbol());
if (commodity_details && comm.has_annotation())
- put_annotation(st, as_annotated_commodity(comm).details);
+ put_annotation(st.put("annotation", ""), as_annotated_commodity(comm).details);
}
} // namespace ledger