talira

JSON for Modern C++

What if JSON was part of modern C++?

open sourceMITfree

JSON for Modern C++ (nlohmann/json) is a header-only C++11 library that makes JSON feel like a first-class C++ type: the whole library is one header, json.hpp, and a json value works like an STL container, with intuitive syntax for parsing, creating, accessing and dumping JSON. It converts arbitrary types to and from JSON, reads and writes the binary formats BSON, CBOR, MessagePack, UBJSON and BJData, and supports JSON Pointer, JSON Patch and diff, JSON Merge Patch, comments, ordered objects and use without exceptions. It's designed for easy integration and developer speed rather than being the fastest JSON parser.

Ways to install

Problems it solves

  • parse and write JSON in C++
  • a header-only JSON library I can drop into a C++ project
  • convert my C++ structs to and from JSON
  • read MessagePack or CBOR in C++

Features

  • single header, header-only
  • STL-like json type
  • arbitrary type conversions
  • BSON, CBOR, MessagePack, UBJSON and BJData
  • JSON Pointer, JSON Patch and Merge Patch
  • works without exceptions