C++的Json头文件与lib库,包括win32与64位。
Json使用方法如下:
Json::Value root;
Json::Value Head;
root["gatewayIP"] = Json::Value(gatewayIP);
root["repeaterIP"] = repeaterIP;
root["groupAccount"] = groupAccount;
root["groupPwd"] = groupPwd;
root["agentAccount"] = agentAccount;
Json::Value narrowId1;
Json::Value narrowId2;
narrowId1["nBGroupID"] = nBGroupID1;
narrowId1["sLAccount"] = sLAccount1;
narrowId2["nBGroupID"] = nBGroupID2;
narrowId2["sLAccount"] = sLAccount2;
if(0 < nBGroupID1.size()){
root["nBGroups"].append(narrowId1);
}
if(0 < nBGroupID2.size()){
root["nBGroups"].append(narrowId2);
}
string tmpdata = root.toStyledString();
strcpy_s(http->buff_root, strlen(tmpdata.c_str())+1, tmpdata.c_str());
cout<<"buff_root :"<< http->buff_root << endl;
1