C/C ++ JSON解析器 [英] C/C++ JSON parser
问题描述
我们的应用程序中有C/C ++解析器的要求.应用程序所要做的就是调用rest webservice并从服务中获取输出.如果输出为JSON,则应解析它并将结果显示给最终用户.
We have requirement of C/C++ Parser in my application. What application does is it calls rest webservice and takes output from service. If output is JSON , it should parse it and shows the result to end user.
能否请您(根据您)向我推荐一个好的/最好的C/CPP JSON解析器,以便可以在我的应用程序中使用?
Could you please recommend me good/best C/CPP JSON parser (according to you) so that I can use in my application?
当我在线搜索时,我得到了多个JSON解析器.但是我想知道最好的.
When I search online, I am getting multiple JSON parsers. But I would like to know about the best.
预先感谢
推荐答案
Assuming you're happy with a C++ implementation of the parser, I've not had any issues with nlohmann/json; although there are faster libraries it has been fast enough for my requirements and has the advantages that:
- 很容易集成到您的项目中(单个标题)
- 干净简洁的API,语法没有过多冗长
- 良好的测试覆盖率
上面链接的Github页面有一个很好的概述,因此我不值得在这里进行更多详细的介绍.
The Github page linked above has a great overview so it's not worth me going into much more detail here.
要比较多个方面的库(而不仅仅是性能),可以在这里查看: miloyip/nativejson基准测试
For a comparison of libraries along multiple facets (not just performance) you could look here: miloyip/nativejson-benchmark
这篇关于C/C ++ JSON解析器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!