[](https://github.com/nlohmann/json/releases)
[](https://ci.appveyor.com/project/nlohmann/json)
[](https://github.com/nlohmann/json/actions?query=workflow%3AUbuntu)
[](https://github.com/nlohmann/json/actions?query=workflow%3AmacOS)
[](https://github.com/nlohmann/json/actions?query=workflow%3AWindows)
[](https://coveralls.io/github/nlohmann/json?branch=develop)
[](https://scan.coverity.com/projects/nlohmann-json)
[](https://app.codacy.com/gh/nlohmann/json/dashboard?utm_source=gh&utm_medium=referral&utm_content=&utm_campaign=Badge_grade)
[](https://cirrus-ci.com/github/nlohmann/json)
[](https://bugs.chromium.org/p/oss-fuzz/issues/list?sort=-opened&can=1&q=proj:json)
[](https://wandbox.org/permlink/1mp10JbaANo6FUc7)
[](https://json.nlohmann.me)
[](https://raw.githubusercontent.com/nlohmann/json/master/LICENSE.MIT)
[](https://github.com/nlohmann/json/releases)
[](https://repology.org/project/nlohmann-json/versions)
[](https://github.com/nlohmann/json/releases)
[](https://github.com/nlohmann/json/issues)
[](https://isitmaintained.com/project/nlohmann/json "Average time to resolve an issue")
[](https://bestpractices.coreinfrastructure.org/projects/289)
[](https://scorecard.dev/viewer/?uri=github.com/nlohmann/json)
[](https://github.com/sponsors/nlohmann)
[](https://api.reuse.software/info/github.com/nlohmann/json)
[](https://discord.gg/6mrGXKvX7y)
- [Design goals](#design-goals)
- [Sponsors](#sponsors)
- [Support](#support) ([documentation](https://json.nlohmann.me), [FAQ](https://json.nlohmann.me/home/faq/), [discussions](https://github.com/nlohmann/json/discussions), [API](https://json.nlohmann.me/api/basic_json/), [bug issues](https://github.com/nlohmann/json/issues))
- [Quick reference](#quick-reference)
- [Examples](#examples)
- [Read JSON from a file](#read-json-from-a-file)
- [Creating `json` objects from JSON literals](#creating-json-objects-from-json-literals)
- [JSON as first-class data type](#json-as-first-class-data-type)
- [Serialization / Deserialization](#serialization--deserialization)
- [STL-like access](#stl-like-access)
- [Conversion from STL containers](#conversion-from-stl-containers)
- [JSON Pointer and JSON Patch](#json-pointer-and-json-patch)
- [JSON Merge Patch](#json-merge-patch)
- [Implicit conversions](#implicit-conversions)
- [Conversions to/from arbitrary types](#arbitrary-types-conversions)
- [Specializing enum conversion](#specializing-enum-conversion)
- [Binary formats (BSON, CBOR, MessagePack, UBJSON, and BJData)](#binary-formats-bson-cbor-messagepack-ubjson-and-bjdata)
- [Customers](#customers)
- [Supported compilers](#supported-compilers)
- [Integration](#integration)
- [CMake](#cmake)
- [Package Managers](#package-managers)
- [Pkg-config](#pkg-config)
- [License](#license)
- [Contact](#contact)
- [Thanks](#thanks)
- [Used third-party tools](#used-third-party-tools)
- [Notes](#notes)
- [Execute unit tests](#execute-unit-tests)
## Design goals
There are myriads of [JSON](https://json.org) libraries out there, and each may even have its reason to exist. Our class had these design goals:
- **Intuitive syntax**. In languages such as Python, JSON feels like a first class data type. We used all the operator magic of modern C++ to achieve the same feeling in your code. Check out the [examples below](#examples) and you'll know what I mean.
- **Trivial integration**. Our whole code consists of a single header file [`json.hpp`](https://github.com/nlohmann/json/blob/develop/single_include/nlohmann/json.hpp). That's it. No library, no subproject, no dependencies, no complex build system. The class is written in vanilla C++11. All in all, everything should require no adjustment of your compiler flags or project settings. The library is also included in all popular [package managers](https://json.nlohmann.me/integration/package_managers/).
- **Serious testing**. Our code is heavily [unit-tested](https://github.com/nlohmann/json/tree/develop/tests/src) and covers [100%](https://coveralls.io/r/nlohmann/json) of the code, including all exceptional behavior. Furthermore, we checked with [Valgrind](https://valgrind.org) and the [Clang Sanitizers](https://clang.llvm.org/docs/index.html) that there are no memory leaks. [Google OSS-Fuzz](https://github.com/google/oss-fuzz/tree/master/projects/json) additionally runs fuzz tests against all parsers 24/7, effectively executing billions of tests so far. To maintain high quality, the project is following the [Core Infrastructure Initiative (CII) best practices](https://bestpractices.coreinfrastructure.org/projects/289). See the [quality assurance](https://json.nlohmann.me/community/quality_assurance) overview documentation.
Other aspects were not so important to us:
- **Memory efficiency**. Each JSON object has an overhead of one pointer (the maximal size of a union) and one enumeration element (1 byte). The default generalization uses the following C++ data types: `std::string` for strings, `int64_t`, `uint64_t` or `double` for numbers, `std::map` for objects, `std::vector` for arrays, and `bool` for Booleans. However, you can template the generalized class `basic_json` to your needs.
- **Speed**. There are certainly [faster JSON libraries](https://github.com/miloyip/nativejson-benchmark#parsing-time) out there. However, if your goal is to speed up your development by adding JSON support with a single header, then this library is the way to go. If you know how to use a `std::vector` or `std::map`, you are already set.
See the [contribution guidelines](https://github.com/nlohmann/json/blob/master/.github/CONTRIBUTING.md#please-dont) for more information.
## Sponsors
You can sponsor this library at [GitHub Sponsors](https://github.com/sponsors/nlohmann).
### :raising_hand: Priority Sponsor
- [Martti Laine](https://github.com/codeclown)
- [Paul Harrington](https://github.com/phrrngtn)
### :label: Named Sponsors
- [Michael Hartmann](https://github.com/reFX-Mike)
- [Stefan Hagen](https://github.com/sthagen)
- [Steve Sperandeo](https://github.com/homer6)
- [Robert Jefe Lindstädt](https://github.com/eljefedelrodeodeljefe)
- [Steve Wagner](https://github.com/ciroque)
- [Lion Yang](https://github.com/LionNatsu)
### Further support
没有合适的资源?快使用搜索试试~ 我知道了~
资源推荐
资源详情
资源评论






























收起资源包目录





































































































共 1162 条
- 1
- 2
- 3
- 4
- 5
- 6
- 12
资源评论



DA0221
- 粉丝: 870
上传资源 快速赚钱
我的内容管理 展开
我的资源 快来上传第一个资源
我的收益
登录查看自己的收益我的积分 登录查看自己的积分
我的C币 登录后查看C币余额
我的收藏
我的下载
下载帮助


最新资源
- (源码)基于 XIAO ESPC3 微控制器的无线 Cyberpuck 鼠标.zip
- 基于COMSOL的单相变压器绕组及铁芯振动形变仿真模型研究与应用
- 基于非支配排序的多目标小龙虾优化算法求解柔性作业车间调度问题(FJSP)的MATLAB实现
- 基于博弈树和NMPC的无信号灯T型路口车辆冲突智能运动规划策略研究 NMPC 终极版
- 移动边缘计算中基于差分进化算法的任务卸载与资源调度研究及MATLAB实现
- 离网风电耦合PEM电解水制氢系统的建模与优化:非并网风电制氢技术的应用研究
- 基于五次多项式的快速自由换道轨迹规划(DLC方法)的MATLAB或Python实现:针对性设计评价成本函数与三车道场景仿真demo
- 基于西门子S7-300PLC与S7-1200PLC的污水处理控制系统全套资料:包含触摸屏仿真画面图纸文档,兼容博图V16及以上版本
- 永磁直驱风力发电系统(PMSG)的并网装置仿真与优化控制策略 2025版
- 燃料电池汽车Cruise-MATLABSimulink联合仿真的多点恒功率控制策略研究
- 基于Lyapunov方法的欠驱动无人船USV路径与轨迹跟踪控制策略实现——11-trans顶刊代码复现 - 非线性控制
- 双馈风力发电机变流器Simulink仿真模型及参数突变研究
- 非奇异快速终端滑模控制(NFTSMC)在三自由度水面艇轨迹跟踪中的应用研究及MatlabSimulink实现
- 基于PLC的S7-1200智能交通灯控制系统:博途编程与Wincc组态仿真及报告研究 WinCC 必备版
- 西门子S7-200PLC与组态王联合打造物料传送带四传送带智能控制系统 终极版
- 西门子S7-200PLC与组态王在三层电梯控制系统中的设计与实现
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈



安全验证
文档复制为VIP权益,开通VIP直接复制
