wxwidgets如何处理JSON格式数据
2012-09-20 TECH wxJSON wxWidgets
下载:http://wxcode.sourceforge.net/components/wxjson/
说明文档:http://wxcode.sourceforge.net/docs/wxjson/
注意:wxJSON 对应于JSON格式要求比较严格,压缩格式的json格式无法识别
示例:
wxString json = "" //json数据, wxJSONValue root; //json value -- root wxJSONReader reader;//json code -- parser wxJSONValue data; //json data int ERR = reader.Parse(json, &root); if ( ERR>0 ) { wxMessageBox( _T("JSON数据格式化失败") , _T("错误")); } else { data = root["TEST"]; for(int i=0; i<data.Size();i++) { wxString tmp = T[i]["something"].AsString(); //something } }
下一篇: 近期小结
暂无评论