Json::Value root;
...
// 转为格式化字符串,里面加了空格及换行符
string strJson1 = root.toStyledString();
// 转为未格式化字符串,无多余空格及换行符
string strJson2 = Json::FastWriter().write(root);
Json::Value root;
...
// 转为格式化字符串,里面加了空格及换行符
string strJson1 = root.toStyledString();
// 转为未格式化字符串,无多余空格及换行符
string strJson2 = Json::FastWriter().write(root);