91av视频/亚洲h视频/操亚洲美女/外国一级黄色毛片 - 国产三级三级三级三级

  • 大小: 1.36MB
    文件類型: .zip
    金幣: 2
    下載: 0 次
    發(fā)布日期: 2023-08-27
  • 語言: C/C++
  • 標(biāo)簽: Json??c++??obj??

資源簡介

json 字符串轉(zhuǎn)成c++類對象,json 字符串轉(zhuǎn)成c++類對象

資源截圖

代碼片段和文件信息

#include?“IParseJson.h“
#include??//?sort
#include?
#include?
#include?
IParseJson*?IParseJson::CreateJsonItem(?string?strKey?)
{
????return?this;
}

void?IParseJson::PrintValueTree(?Json::Value?&value?IParseJson*?pParent?IParseJson*?pobj?const?std::string?strkey?)
{
????IParseJson*?pTmpJsonNode?=?NULL;
????switch?(?value.type()?)
????{
????????case?Json::nullValue:
????????????{
????????????????break;
????????????}
????????case?Json::intValue:
????????????pobj->DealJsonNode(?strkey?value.asInt()?);
????????????break;
????????case?Json::uintValue:
????????????pobj->DealJsonNode(?strkey?value.asUInt()?);
????????????break;
????????case?Json::realValue:
????????????pobj->DealJsonNode(?strkey?value.asDouble()?);
????????????break;
????????case?Json::stringValue:
????????????pobj->DealJsonNode(?strkey?value.asString()?);
????????????break;
????????case?Json::booleanValue:
????????????pobj->DealJsonNode(?strkey?value.asBool()?);
????????????break;
????????case?Json::arrayValue:
????????????{
????????????????int?size?=?value.size();

????????????????for?(?int?index?=0;?index?????????????????{
????????????????????pTmpJsonNode?=?pParent->CreateJsonItem(?strkey?);
????????????????????PrintValueTree(?value[index]?pParent?pTmpJsonNode?strkey?);
????????????????}

????????????}
????????????break;
????????case?Json::objectValue:
????????????{
????????????????Json::Value::Members?members(?value.getMemberNames()?);
????????????????std::sort(?members.begin()?members.end()?);
????????????????std::string?suffix?=?““;
????????????????for?(?Json::Value::Members::iterator?it?=?members.begin();
????????????????????????it?!=?members.end();
????????????????????????++it?)
????????????????{
????????????????????const?std::string?&name?=?*it;

????????????????????PrintValueTree(?value[name]?pobj?pobj?name?);

????????????????}
????????????}
????????????break;
????????default:
????????????break;
????}
}



BOOL?IParseJson::ParseJson(?const?char*?json?)
{

????Json::Features?features;
????Json::Reader?reader(?features?);
????Json::Value?root;
????bool?parsingSuccessful?=?reader.parse(?json?root?);
????if?(?!parsingSuccessful?)
????{
????????return?FALSE;
????}

????PrintValueTree(?root?this?this??““?);
????return?TRUE;
}


?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????目錄???????????0??2014-05-09?16:52??Json_Obj_demo\
?????目錄???????????0??2014-05-09?16:47??Json_Obj_demo\Debug\
?????文件????????3046??2014-05-09?16:47??Json_Obj_demo\Debug\cl.command.1.tlog
?????文件???????45628??2014-05-09?16:47??Json_Obj_demo\Debug\CL.read.1.tlog
?????文件????????5578??2014-05-09?16:47??Json_Obj_demo\Debug\CL.write.1.tlog
?????文件??????308183??2014-05-09?16:40??Json_Obj_demo\Debug\IParseJson.obj
?????文件?????????406??2014-05-09?16:40??Json_Obj_demo\Debug\Json_Obj_demo.exe.embed.manifest
?????文件?????????472??2014-05-09?16:40??Json_Obj_demo\Debug\Json_Obj_demo.exe.embed.manifest.res
?????文件?????????381??2014-05-09?16:47??Json_Obj_demo\Debug\Json_Obj_demo.exe.intermediate.manifest
?????文件??????????76??2014-05-09?16:47??Json_Obj_demo\Debug\Json_Obj_demo.lastbuildstate
?????文件????????2504??2014-05-09?16:47??Json_Obj_demo\Debug\Json_Obj_demo.log
?????文件??????626810??2014-05-09?16:47??Json_Obj_demo\Debug\Json_Obj_demo.obj
?????文件?????????216??2014-05-09?16:40??Json_Obj_demo\Debug\Json_Obj_demo_manifest.rc
?????文件???????????2??2014-05-09?16:47??Json_Obj_demo\Debug\link-cvtres.read.1.tlog
?????文件???????????2??2014-05-09?16:47??Json_Obj_demo\Debug\link-cvtres.write.1.tlog
?????文件???????????2??2014-05-09?16:47??Json_Obj_demo\Debug\link.5456-cvtres.read.1.tlog
?????文件???????????2??2014-05-09?16:47??Json_Obj_demo\Debug\link.5456-cvtres.write.1.tlog
?????文件???????????2??2014-05-09?16:47??Json_Obj_demo\Debug\link.5456.read.1.tlog
?????文件???????????2??2014-05-09?16:47??Json_Obj_demo\Debug\link.5456.read.2.tlog
?????文件???????????2??2014-05-09?16:47??Json_Obj_demo\Debug\link.5456.write.1.tlog
?????文件???????????2??2014-05-09?16:47??Json_Obj_demo\Debug\link.5580-cvtres.read.1.tlog
?????文件???????????2??2014-05-09?16:47??Json_Obj_demo\Debug\link.5580-cvtres.write.1.tlog
?????文件???????????2??2014-05-09?16:47??Json_Obj_demo\Debug\link.5580.read.1.tlog
?????文件???????????2??2014-05-09?16:47??Json_Obj_demo\Debug\link.5580.read.2.tlog
?????文件???????????2??2014-05-09?16:47??Json_Obj_demo\Debug\link.5580.write.1.tlog
?????文件???????????2??2014-05-09?16:47??Json_Obj_demo\Debug\link.5652-cvtres.read.1.tlog
?????文件???????????2??2014-05-09?16:47??Json_Obj_demo\Debug\link.5652-cvtres.write.1.tlog
?????文件???????????2??2014-05-09?16:47??Json_Obj_demo\Debug\link.5652.read.1.tlog
?????文件???????????2??2014-05-09?16:47??Json_Obj_demo\Debug\link.5652.read.2.tlog
?????文件???????????2??2014-05-09?16:47??Json_Obj_demo\Debug\link.5652.write.1.tlog
?????文件????????2394??2014-05-09?16:47??Json_Obj_demo\Debug\link.command.1.tlog
............此處省略45個文件信息

評論

共有 條評論