Skip to content

前一个项目用到rapidjson,速度是快,但是缺点就是接口使用起来感觉不是很和谐,于是打算封装一下. rapidjson: https://github.com/Tencent/rapidjson

Notifications You must be signed in to change notification settings

yuling3437/rapidjson_wrapper

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

rapidjson_wrapper

  1. 修改CMakeList.txt中的包含目录到rapidjson

  2. cmake

  3. make

简化了原生rapidjson生成json串的复杂书写过程 支持了几种基本操作,获取值的操作可以自己后期增加

JsonWrapper w, w1, w2;

w.Prase("[1]");

w[1] = "2";

w["a"] = 1; //err

cout<<"w:"<<w.ToString()<<endl; //输出 w:[1,"2"]

w1["a"] = 1;

w1["b"] = 2;

w1["c"] = &w; //deep copy w 不变

w1["d"] = w; //move w 变成 null

cout<<"w:"<<w.ToString()<<endl; //输出 w:null

cout<<"w1:"<<w1.ToString()<<endl; //输出 w1:{"a":1,"b":2,"c":[1,"2"],"d":[1,"2"]}

w[1] = w1;

cout<<"w:"<<w.ToString()<<endl; //输出 w:[{"a":1,"b":2,"c":[1,"2"],"d":[1,"2"]}]

About

前一个项目用到rapidjson,速度是快,但是缺点就是接口使用起来感觉不是很和谐,于是打算封装一下. rapidjson: https://github.com/Tencent/rapidjson

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published