hvlib中复杂json解析(转)
nlohmann::json objProcess_instance = jsonRes["process_instance"].get<nlohmann::json>();
vector<nlohmann::json> objForm_component_values = objProcess_instance["form_component_values"].get<vector<nlohmann::json>>();
for (vector<nlohmann::json>::iterator vi = objForm_component_values.begin(); vi != objForm_component_values.end(); vi++)
{
string name = (*vi)["name"].get<string>();
string strName = U2G(name.c_str());
string value = (*vi)["value"].get<string>();
string strValue = U2G(value.c_str());
OutputDebugStringA("");
}
json格式
{
"errcode":0,
"errmsg":"ok",
"process_instance":{
"form_component_values":[
{
"component_type":"TextField",
"name":"请假天数",
"id":"TextField_23QXWOU7G4JK0",
"value":"1"
}
],
"create_time":"2020-12-21 15:30:26",
"attached_process_instance_ids":[],
————————————————
版权声明:本文为CSDN博主「请设置昵称啊」的原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接及本声明。
原文链接:https://blog.csdn.net/qq_39759458/article/details/117471826
浙公网安备 33010602011771号