//定义json
Json::Value json;
Json::FastWriter writer;
//加字段
json["linewidth"] = 1;
Json::Value point;
point["topLeft_x"] = 1;
//json里加json
json["paintdata"] = point;
//转成string
std::string str_data = writer.write(json);
Json::Value json;
Json::Reader reader;
//从string读json
if (reader.parse(str, json))
{
int width = json["linewidth"].asInt();
Json::Value data = json["paintdata"];
。。。。。。
}