Git Product home page Git Product logo

cson's People

Contributors

sunchb avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

cson's Issues

关于struct转raw json

不好意思额,又来麻烦大佬,,按照教程可以成功跑通,
image
这是成功转换的json字符串,如果想转成如下图的raw json的话
image
,里面有提供接口么,还是要自己修改print_value函数

关于字符串数组的解析错误

谢谢作者提供这么好的代码,想问下是不是现在不能解析字符串数组,
在测试test1.c时出现错误
!!!!parse error on field:strList, cod=-3!!!!
decode ret=0

解析结构性数组对象时,会出现段错误

当解析如下的json文件时,出现Segmentation
{ "songList":[ { "cmd": { "offset": 14, "len": 1, "bit_index": 0 }, "status": { "offset": 10, "len": 1 } }, { "status": { "offset": 10, "len": 1 } } ] }
区别在于,数组对象中,其中有一个缺少cmd对象,不完整,在某些场景下会存在的情况。
分析代码是段在了parseJsonObjectDefault 521行判断处
Thread 1 received signal SIGSEGV, Segmentation fault.
0x0000000000402f61 in parseJsonObjectDefault ()

附件是我根据错误修改的,看下是否正确?

fix.patch

根据json数据自动生成结构体和反射

有一个想法,如果提供一个根据json数据自动生成结构体和反射函数的接口,对于那些动辄几十个甚至几百个KV的json转结构体,是很必要的。手动构建这些结构体,将是一个体力活。

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.