JsonCpp的使用

1. arrayValue 和 vector的转换

//
                         Json :: Value root ;
                                 vector<string>  m_vctProcedureUID;

                              for ( std :: vector < tstring >:: iterator iter = m_vctProcedureUID . begin (); iter != m_vctProcedureUID . end (); iter ++)
                                {
                                                 root [ "ProcedureUID" ]. append ( T2A (* iter ));
                                }

//
                                Json :: Value   root ;
                                vector<string>  m_vctProcedureUID;

                              Json::Value procedureUIDList = root["ProcedureUID"];
                                 for ( Json :: Value :: iterator iter = procedureUIDList . begin (); iter != procedureUIDList . end (); iter ++)
                                {
                                                 m_vctProcedureUID . push_back ( A2T ((* iter ). asString ()));
                                }

你可能感兴趣的:(C#)