美文网首页
三个开源C/C++ json解释器简单使用比较

三个开源C/C++ json解释器简单使用比较

作者: newjourney2018 | 来源:发表于2018-09-30 14:34 被阅读0次

在github上搜json,第一个就是moder json c++,这个号称moder c++,令人失望的是解析后面字串失败。

第二个是jsoncpp,循环解析时候会有内存泄漏。

第三个是cJSON,前面俩是c++写的,这个是c写的,但是只有这个目前工作正常。

{

messages: 

[

{

body: "sfsaf;';,12875'/.<>?":{}{<M*&^&*%$!!$09785=-09174876FKJ爱上了;快点减肥撒飞机撒的飞机啊是",

is_picture: "1",

from_user: 

{

message_state: "0",

name: "医疗",

nick_name: "visitor2",

gender: "0",

avatar_video: "",

score: "0",

create_time: "1534235016.0",

follow_state: "0",

avatar_picture: "https://www.xxxx.com/media/account/default.webp",

org: 

{

website: "",

city: "成都",

fax: "",

post_code: "",

name: "大主宰",

short_name: "",

country: "中国",

industry: "医疗",

phone: "",

create_time: "1537775459.0",

address: "",

id: "14",

desc: ""

},

last_update: "1534235016.0",

friendship: "0",

id: "1",

desc: ""

},

id: "28",

chat_id: "2"

},

{

body: "dsfsfsadfs",

is_picture: "0",

from_user: 

{

message_state: "0",

name: "医疗",

nick_name: "visitor2",

gender: "0",

avatar_video: "",

score: "0",

create_time: "1534235016.0",

follow_state: "0",

avatar_picture: "https://www.xxxx.com/media/account/default.webp",

org: 

{

website: "",

city: "成都",

fax: "",

post_code: "",

name: "大主宰",

short_name: "",

country: "中国",

industry: "医疗",

phone: "",

create_time: "1537775459.0",

address: "",

id: "14",

desc: ""

},

last_update: "1534235016.0",

friendship: "0",

id: "1",

desc: ""

},

id: "27",

chat_id: "2"

},

{

body: "lkjlkj",

is_picture: "0",

from_user: 

{

message_state: "0",

name: "医疗",

nick_name: "visitor2",

gender: "0",

avatar_video: "",

score: "0",

create_time: "1534235016.0",

follow_state: "0",

avatar_picture: "https://www.xxxx.com/media/account/default.webp",

org: 

{

website: "",

city: "成都",

fax: "",

post_code: "",

name: "大主宰",

short_name: "",

country: "中国",

industry: "医疗",

phone: "",

create_time: "1537775459.0",

address: "",

id: "14",

desc: ""

},

last_update: "1534235016.0",

friendship: "0",

id: "1",

desc: ""

},

id: "26",

chat_id: "2"

},

{

body: "lkjlkj",

is_picture: "0",

from_user: 

{

message_state: "0",

name: "医疗",

nick_name: "visitor2",

gender: "0",

avatar_video: "",

score: "0",

create_time: "1534235016.0",

follow_state: "0",

avatar_picture: "https://www.xxxxx.com/media/account/default.webp",

org: 

{

website: "",

city: "成都",

fax: "",

post_code: "",

name: "大主宰",

short_name: "",

country: "中国",

industry: "医疗",

phone: "",

create_time: "1537775459.0",

address: "",

id: "14",

desc: ""

},

last_update: "1534235016.0",

friendship: "0",

id: "1",

desc: ""

},

id: "25",

chat_id: "2"

},

{

body: "sdfsfd",

is_picture: "0",

from_user: 

{

message_state: "0",

name: "医疗",

nick_name: "visitor2",

gender: "0",

avatar_video: "",

score: "0",

create_time: "1534235016.0",

follow_state: "0",

avatar_picture: "https://www.xxxxx.com/media/account/default.webp",

org: 

{

website: "",

city: "成都",

fax: "",

post_code: "",

name: "大主宰",

short_name: "",

country: "中国",

industry: "医疗",

phone: "",

create_time: "1537775459.0",

address: "",

id: "14",

desc: ""

},

last_update: "1534235016.0",

friendship: "0",

id: "1",

desc: ""

},

id: "24",

chat_id: "2"

}

]

}

相关文章

网友评论

      本文标题:三个开源C/C++ json解释器简单使用比较

      本文链接:https://www.haomeiwen.com/subject/dmdwoftx.html