24,854
社区成员
发帖
与我相关
我的任务
分享
std::string test = "{\"test\":5,\
\"Value\":{\"version\":\"this is version\"}}";
Json::Reader reader;
Json::Value value;
if(reader.parse(test,value))
{
int i = 0;
bool isNull = value["test"].isNull();
if(!isNull)
i = value["test"].asInt();
if(!value["Value"]["version"].isNull())
{
std::string str = value["Value"]["version"].asString();
}
Json::Value val1= value["OtherKey"];
if(!val1.isNull())
{
i = val1.asInt();
}
}