rapidjson解析

 rapidjson::Document doc;
 doc.Parse<0>(cmd.c_str());
 if (!doc.IsObject())
 {
  return;
 }


void ScreenSplit(rapidjson::Document &tmpDoc, string *res)
{
 if (tmpDoc.HasMember("screen_id"))
 {
     int nScreenID = tmpDoc["screen_id"].GetInt();
  if (tmpDoc.HasMember("reset"))
  {
   int nStatus = tmpDoc["reset"].GetInt();
   if (tmpDoc.HasMember("number"))
   {
    int nWndNum = tmpDoc["number"].GetInt();
    tagScreenSplit *pScreensplit = new tagScreenSplit;
    pScreensplit->nNumber = nWndNum;
    pScreensplit->nReset = nStatus;
    pScreensplit->nScreenid = nScreenID-1;
    ::PostMessage(g_pMgMonitorDlg->m_hWnd, WM_PLCTEXT_SPLITSCREEN,(WPARAM)pScreensplit,NULL);
   }
  }
 }
}

你可能感兴趣的:(json)