GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Categories
  • Newsletter
  • Submit
  • Login
  • Awesome C++
  • JSON

This view

  • Original page
  • New address

GeezerVison is showing cpp.libhunt.com — JSON++ Alternatives - C++ JSON | LibHunt

  • Subscribe
  • Submit
  • Categories
  • About
  • Login

JSON++

A JSON parser in C++

DISCONTINUED. You can find some alternatives below.
Suggest Changes
Take the C++ Developer Survey - About 6 minutes on the tools, libraries and AI you use with C++. You get the results by email. Take the survey »
Popularity
4.7
Stable
Activity
0.0
Stable
Stars 485
Watchers 38
Forks 168
Last Commit almost 6 years ago

Code Quality Rank: L1
Programming language: C++
License: MIT License
Tags: JSON    

JSON++ alternatives and similar libraries

Based on the "JSON" category.
Alternatively, view JSON++ alternatives based on common mentions on social networks and blogs.

  • json

    9.9 9.8 L1 JSON++ VS json
    JSON for Modern C++
    nlohmann logo
  • RapidJSON

    9.5 0.0 L1 JSON++ VS RapidJSON
    A fast JSON parser/generator for C++ with both SAX/DOM style API
    Tencent logo
  • SaaSHub - Software Alternatives and Reviews

    SaaSHub helps you find the best software and product alternatives
    Promo www.saashub.com
    SaaSHub Logo
  • simdjson

    9.5 9.5 JSON++ VS simdjson
    Parsing gigabytes of JSON per second : used by Facebook/Meta Velox, the Node.js runtime, ClickHouse, WatermelonDB, Apache Doris, Milvus, StarRocks
    simdjson logo
  • cJSON

    9.4 3.9 L3 JSON++ VS cJSON
    Ultralightweight JSON parser in ANSI C
    DaveGamble logo
  • JsonCpp

    9.1 7.8 L1 JSON++ VS JsonCpp
    A C++ library for interacting with JSON.
    open-source-parsers logo
  • yaml-cpp

    8.7 8.1 JSON++ VS yaml-cpp
    A YAML parser and emitter in C++
    jbeder logo
  • ArduinoJson

    8.6 5.1 JSON++ VS ArduinoJson
    📟 JSON library for Arduino and embedded C++. Simple and efficient.
    bblanchon logo
  • JSMN

    7.8 0.0 L3 JSON++ VS JSMN
    Jsmn is a world fastest JSON parser/tokenizer. This is the official repo replacing the old one at Bitbucket
    zserge logo
  • json-c

    7.8 8.7 JSON++ VS json-c
    https://github.com/json-c/json-c is the official code repository for json-c. See the wiki for release tarballs for download. API docs at http://json-c.github.io/json-c/
    json-c logo
  • Jansson

    7.7 7.2 L2 JSON++ VS Jansson
    C library for encoding, decoding and manipulating JSON data
    akheron logo
  • json11

    7.5 0.6 L2 JSON++ VS json11
    DISCONTINUED. A tiny JSON library for C++11. [MIT]
  • YAJL

    7.0 0.0 L3 JSON++ VS YAJL
    A fast streaming JSON parsing library in C.
    lloyd logo
  • LIBUCL

    6.2 8.1 L2 JSON++ VS LIBUCL
    Universal configuration library parser
    vstakhov logo
  • json-parser

    6.0 5.3 L1 JSON++ VS json-parser
    Very low footprint DOM-style JSON parser written in portable ANSI C
    json-parser logo
  • PicoJSON

    5.8 0.0 L1 JSON++ VS PicoJSON
    a header-file-only, JSON parser serializer in C++
    kazuho logo
  • frozen

    5.1 2.6 L1 JSON++ VS frozen
    JSON parser and generator for C/C++ with scanf/printf like interface. Targeting embedded systems.
    cesanta logo
  • json.h

    4.8 7.8 JSON++ VS json.h
    🗄️ single header json parser for C and C++
    sheredom logo
  • QJson

    3.9 1.9 L1 JSON++ VS QJson
    DISCONTINUED. QJson is a qt-based library that maps JSON data to QVariant objects.
    flavio logo
  • qt-json

    3.8 0.0 L3 JSON++ VS qt-json
    DISCONTINUED. A simple class for parsing JSON data into a QVariant hierarchy and vice versa.
    qt-json logo
  • libjson

    3.8 1.4 L3 JSON++ VS libjson
    a JSON parser and printer library in C. easy to integrate with any model.
    vincenthz logo
  • Boost.PropertyTree

    3.1 0.7 L1 JSON++ VS Boost.PropertyTree
    Boost.org property_tree module
    boostorg logo
  • json_dto

    2.9 7.4 JSON++ VS json_dto
    A small header-only library for converting data between json representation and c++ structs
    Stiffstream logo
  • JeayeSON

    2.8 0.0 L2 JSON++ VS JeayeSON
    A very sane (header only) C++14 JSON library
    jeaye logo
  • json-voorhees

    2.7 9.3 L3 JSON++ VS json-voorhees
    A killer modern C++ library for interacting with JSON.
    tgockel logo
  • StructMapping

    2.6 0.0 JSON++ VS StructMapping
    Mapping json to and from a c++ structure
    bk192077 logo
  • Jsonifier

    2.4 4.7 JSON++ VS Jsonifier
    A few classes for extremely fast json parsing/serializing in modern C++. Possibly the fastest json parser in C++. Possibly the fastest json serializer in C++.
    nihilai-collective logo
  • jute

    2.4 2.2 L3 JSON++ VS jute
    Very simple C++ JSON Parser
    amir-s logo
  • ujson

    2.3 - JSON++ VS ujson
    µjson is a a small, C++11, UTF-8, JSON library. [MIT]
  • iod.metajson

    2.0 0.0 JSON++ VS iod.metajson
    Non-intrusive, high performance C++17 lightweight JSON de/serializer
    iodcpp logo
  • jvar

    1.8 0.0 JSON++ VS jvar
    JS inspired Variants and JSON parsing for C++
    YasserAsmi logo
  • jbson

    1.8 0.0 L1 JSON++ VS jbson
    JSON & BSON parser/writer
    chrismanning logo

* Code Quality Rankings and insights are calculated and provided by Lumnify.
They vary from L1 to L5 with "L5" being the highest.

Do you think we are missing an alternative of JSON++ or a related project?

Add another 'JSON' Library

Popular Comparisons

  • JSON++
    vs
    yaml-cpp
  • JSON++
    vs
    RapidJSON
  • JSON++
    vs
    Boost.PropertyTree
  • JSON++
    vs
    json
  • JSON++
    vs
    JsonCpp

README

JSON++

Build Status

Introduction

JSON++ is a light-weight JSON parser, writer and reader written in C++. JSON++ can also convert JSON documents into lossless XML documents.

Contributors

  • http://github.com/hjiang
  • http://github.com/elanthis
  • http://github.com/r-lyeh

If you've made substantial contribution, please add your link here.

Why another JSON parser?

Perhaps because web service clients are usually written in dynamic languages these days, none of the existing C++ JSON parsers fitted my needs very well, so I wrote one that I used in another project. My goals for JSON++ were:

  • Efficient in both memory and speed.
  • No third party dependencies. JSON++ only depends on the standard C++ library.
  • Cross platform.
  • Robust.
  • Small and convenient API. Most of the time, you only need to call one function and two function templates.
  • Easy to integrate. JSON++ only has one source file and one header file. Just compile the source file and link with your program.
  • Able to construct documents dynamically.
  • JSON writer: write documents in JSON format.

Other contributors have sinced added more functionalities:

  • XML writer: convert documents to JSONx format. See http://goo.gl/I3cxs for details.
  • XML writer: convert documents to JXML format. See https://github.com/r-lyeh/JXML for details.
  • XML writer: convert documents to JXMLex format. See https://github.com/r-lyeh/JXMLex for details.
  • XML writer: convert documents to tagged XML format. See https://github.com/hjiang/jsonxx/issues/12 for details.

Compiler version

You need a modern C++ compiler. For older compilers, please try legacy branch.

Configuration

Strict/permissive parsing

JSONxx can parse JSON documents both in strict or permissive mode.

When jsonxx::Settings::Parser is set to Strict, JSONxx parser will accept:

  • Fully conformant JSON documents only.

When jsonxx::Settings::Parser is set to Permissive, JSONxx parser will accept:

  • Fully conformant JSON documents
  • Ending commas in arrays and objects: { "array": [0,1,2,], }
  • Single quoted strings: ['hello', "world"]
  • C++ style comments: { "width": 320, "height": 240 } //Picture details

Default value is Permissive.

When jsonxx::Settings::UnquotedKeys is set to Enabled, JSONxx parser will accept:

  • Unquoted keys: {name: "world"}

Default value is Disabled.

Assertions

JSONxx uses internally JSONXX_ASSERT(...) macro that works both in debug and release mode. Set jsonxx::Settings::Assertions value to Disabled to disable assertions.

Default value is Enabled.

Usage

The following snippets are from one of the unit tests. They are quite self-descriptive.

using namespace std;
using namespace jsonxx;

string teststr(
        "{"
        "  \"foo\" : 1,"
        "  \"bar\" : false,"
        "  \"person\" : {\"name\" : \"GWB\", \"age\" : 60,},"
        "  \"data\": [\"abcd\", 42],"
        "}"
);

// Parse string or stream
Object o;
assert(o.parse(teststr));

// Validation. Checking for JSON types and values as well
assert(1 == o.get<Number>("foo"));
assert(o.has<Boolean>("bar"));
assert(o.has<Object>("person"));
assert(o.get<Object>("person").has<Number>("age"));
assert(!o.get<Object>("person").has<Boolean>("old"));
assert(o.get<Object>("person").get<Boolean>("old", false));
assert(o.has<Array>("data"));
assert(o.get<Array>("data").get<Number>(1) == 42);
assert(o.get<Array>("data").get<String>(0) == "abcd");
assert(o.get<Array>("data").get<String>(2, "hello") == "hello");
assert(!o.has<Number>("data"));
cout << o.json() << endl;                     // JSON output
cout << o.xml(JSONx) << endl;                 // JSON to XML conversion (JSONx subtype)
cout << o.xml(JXML) << endl;                  // JSON to XML conversion (JXML subtype)
cout << o.xml(JXMLex) << endl;                // JSON to XML conversion (JXMLex subtype)
// Generate JSON document dynamically
using namespace std;
using namespace jsonxx;
Array a;
a << 123;
a << "hello world";
a << 3.1415;
a << 99.95f;
a << 'h';
a << Object("key", "value");
Object o;
o << "key1" << "value";
o << "key2" << 123;
o << "key3" << a;
cout << o.json() << endl;

To do

  • Custom JSON comments (C style /**/) when permissive parsing is enabled.

Do not miss the trending, libraries, news and articles with our weekly report.

Awesome C++ is part of the LibHunt network. Terms. Privacy Policy.

(CC)
BY-SA
Spin The Wheel Of Names for a cryptographically secure random name picker.
Schedule a when to meet poll.
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.