From 7e8ba51cd0fc94776b8f687736202a25ddc39f15 Mon Sep 17 00:00:00 2001 From: John Wiegley Date: Fri, 18 May 2012 01:38:39 -0600 Subject: Added a "json" report command --- src/ptree.cc | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'src/ptree.cc') diff --git a/src/ptree.cc b/src/ptree.cc index 5f7b5766..ca343072 100644 --- a/src/ptree.cc +++ b/src/ptree.cc @@ -74,7 +74,14 @@ void format_ptree::flush() put_post(pt, *post); } - property_tree::write_xml(out, pt); + switch (format) { + case FORMAT_XML: + property_tree::write_xml(out, pt); + break; + case FORMAT_JSON: + property_tree::write_json(out, pt); + break; + } } void format_ptree::operator()(post_t& post) -- cgit v1.2.3