#include "itunes_jason_structure.hpp"
#include <boost/property_tree/json_parser.hpp>
#include <iostream>
using namespace std;
void itunes_json_structure::load(const string &filename)
{
using boost::property_tree::ptree;
try
{
// Load the JSON file into the property tree. If reading fails
// (cannot open file, parse error), an exception is thrown.
read_json(filename, m_ptree);
cout << "resultCount = " << m_ptree.get<string>("resultCount") << endl;
ptree all_results = m_ptree.get_child("results");
// HERE!!! How can I read the content of the "results" node????
}
catch(exception &e)
{
throw e;
}
}
|