All Projects → zsmj2017 → Minijson

zsmj2017 / Minijson

Licence: mit
A lightweight json library (C++)

Programming Languages

cpp
1120 projects

Labels

Projects that are alternatives of or similar to Minijson

Oakdex Pokedex
Ruby Gem and Node Package for comprehensive Generation 1-7 Pokedex data, including 809 Pokémon, uses JSON schemas to verify the data
Stars: ✭ 44 (-10.2%)
Mutual labels:  json
Json Normalizer
📃 Provides generic and vendor-specific normalizers for normalizing JSON documents.
Stars: ✭ 45 (-8.16%)
Mutual labels:  json
Webpub Manifest
📜 A JSON based Web Publication Manifest format used at the core of the Readium project
Stars: ✭ 46 (-6.12%)
Mutual labels:  json
Ndjson
♨️ Wicked-Fast Streaming 'JSON' ('ndjson') Reader in R
Stars: ✭ 44 (-10.2%)
Mutual labels:  json
Fast Xml Parser
Validate XML, Parse XML to JS/JSON and vise versa, or parse XML to Nimn rapidly without C/C++ based libraries and no callback
Stars: ✭ 1,021 (+1983.67%)
Mutual labels:  json
Fiscalberry
[JSON ↔ HW] Connect things using JSON API with the fiscalberry websocket server interact easily with any kind of Hardware. Another IoT solution...
Stars: ✭ 44 (-10.2%)
Mutual labels:  json
Dito
Dito.js is a declarative and modern web framework with a focus on API driven development, based on Objection.js, Koa.js and Vue.js – Released in 2018 under the MIT license, with support by Lineto.com
Stars: ✭ 44 (-10.2%)
Mutual labels:  json
Ansible Config encoder filters
Ansible role used to deliver the Config Encoder Filters.
Stars: ✭ 48 (-2.04%)
Mutual labels:  json
Wheel
关于net nio os cache db rpc json web http udp tcp mq 等多个小工具的自定义实现
Stars: ✭ 45 (-8.16%)
Mutual labels:  json
Node.pas
Asynchronous Event-driven server programming for EMB Delphi, powered by libuv.
Stars: ✭ 45 (-8.16%)
Mutual labels:  json
Graphql Factory
A toolkit for building GraphQL
Stars: ✭ 44 (-10.2%)
Mutual labels:  json
Excel2json
把Excel表转换成json对象,并保存到一个文本文件中。
Stars: ✭ 1,023 (+1987.76%)
Mutual labels:  json
Zeison
Small, fast and easy-to-use JSON library for Scala.
Stars: ✭ 45 (-8.16%)
Mutual labels:  json
Jl Sql
SQL for JSON and CSV streams
Stars: ✭ 44 (-10.2%)
Mutual labels:  json
Univalue
High performance RAII C++ JSON library and universal value object class
Stars: ✭ 46 (-6.12%)
Mutual labels:  json
Snmpbot
Golang SNMP library + SNMP REST API
Stars: ✭ 44 (-10.2%)
Mutual labels:  json
Microblob
Serve millions of JSON documents via HTTP.
Stars: ✭ 45 (-8.16%)
Mutual labels:  json
Resticprofile
Configuration profiles for restic backup
Stars: ✭ 48 (-2.04%)
Mutual labels:  json
Shon
A simple tool to convert json or yaml into a shell-compliant data structure.
Stars: ✭ 47 (-4.08%)
Mutual labels:  json
Jj
JSON Stream Editor (command line utility)
Stars: ✭ 1,033 (+2008.16%)
Mutual labels:  json

MiniJson

Language Standard

JSON is a lightweight data-interchange format. It can represent numbers, strings, ordered sequences of values, and collections of name/value pairs.

MiniJson is a tiny JSON library that allows manipulating JSON values, including serialization and deserialization to and from strings.

MiniJson is written in C++17 and test the code using the GoogleTest framework.The classes are heavily unit-tested and covers 100% of the code, including all exceptional behavior.


The core object provided by the library is MiniJson::Json. A Json object represents any JSON value: null(nullptr_t), bool, number (int or double), string(std::string), array(std::vector), or object (std::unordered_map).

Json objects act like values. They can be assigned, copied, moved, compared for equality and so on. There are also helper methods Json::serialize, to serialize a Json to a string, and Json::parse (static) to parse a std::string or const char* as a Json object.


We can construct a JSON object very intuitively:

Json my_json1(nullptr);
Json my_json2 = "string";

Json my_json3 = Json::_object {
    { "key1", "value1" },
    { "key2", false },
    { "key3", Json::_array { 1, 2, 3 } },
};

String can be expressed explicitly using Json::parse() easily:

string errMsg;// store error messages when catch a exception in parse process
auto js = Json::parse("[ null , false , true , 123 , \"abc\" ]",errmsg);
cout << js[4] << endl;

You can also get a string representation of a JSON value (serialize):

auto str = js.serialize();

Even you can try to output the JSON object directly:

cout << js << endl;

This work is inspired by https://github.com/miloyip/json-tutorial and https://github.com/Yuan-Hang/Json.

More documentation is still to come. For now, please see Json.h.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].