#include #include #include "boost/foreach.hpp" #include "boost/property_tree/xml_parser.hpp" #include "boost/property_tree/json_parser.hpp" #include "boost/property_tree/ptree.hpp" #include "boost/property_tree/detail/xml_parser_writer_settings.hpp" using namespace boost::property_tree; using namespace std; void printLevel(stringstream & sout , const ptree& pt, const unsigned int indent = 0) { BOOST_FOREACH(const ptree::value_type &v, pt) { string key = v.first; string value = v.second.get_value(""); string indent_str = std::string( indent, ' '); sout << indent_str << key << ": \"" << value <<"\"" << endl; if(! v.second.empty() ) printLevel(sout, v.second, indent + 4); } } void logPtree(const ptree& pt) { stringstream ostream; printLevel(ostream, pt); cout <