My C++ program receives a long (thousands of symbols) JSON string, which I'd like to print using JSON Spirit (for debugging) with multiple lines, right indentation etc. For example:
{
"abc": "def",
"xyz":
[
"pqr": "ijk"
]
}
and so on. I tried the write
function:
const json_spirit::Value val("...long JSON string here ...");
cout << json_spirit::write(val, json_spirit::pretty_print) << endl;
but got only additional backslashes in the original string.
Can you please advise how to do that?