C/C ++ JSON解析器 [英] C/C++ JSON parser

查看:124
本文介绍了C/C ++ JSON解析器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们的应用程序中有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.

预先感谢

推荐答案

假设您对解析器的C ++实现感到满意,那么

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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆