https://www.cnblogs.com/wuli-jishu-192-168-23333/p/6215532.html
测试例子:
#include <iostream>
#include <cstdio>
#include <json/json.h>
using namespace std;
int main()
{
Json::Value a,b,c,d,e;
a = 12; //int
b = "hello";//string
c = false; //boolean
d = true; //boolean
//eΪnull
cout << "First" << endl;
cout << a.asInt() << endl;
cout << b.asString() << endl;
cout << c.asString() << endl;
cout << d.asString() << endl;
cout << e.asString() << endl;
//也可以使用复制构造函数来初始化生成JSON对象
a = Json::Value(13);
b = Json::Value("hello world");
c = Json::Value(false);
d = Json::Value(true);
e = Json::Value();
cout << "Second" << endl;
cout << a.asInt() << endl;
cout << b.asString() << endl;
cout << c.asString() << endl;
cout << d.asString() << endl;
cout << e.asString() << endl;
return 0;
}