Skip to content

Vinit-Pandit/jsontoolkit_my

 
 

Repository files navigation

JSON Toolkit

JSON Toolkit is a swiss-army knife for JSON programming in modern C++. It comes with a built-in parser and growing support for standards such as JSON Schema, JSON Pointer, JSONL, and more.

Example

#include <sourcemeta/jsontoolkit/json.h>
#include <sourcemeta/jsontoolkit/jsonpointer.h>
#include <sstream>
#include <iostream>

int main()  {
    // Creating JSON using parse
    sourcemeta::jsontoolkit::JSON document =
        sourcemeta::jsontoolkit::parse(R"JSON({
            "name": "John Doe",
            "age": 20,
            "address": "zxy"
        })JSON");

    // JSON pointer for the name property
    const sourcemeta::jsontoolkit::Pointer name_pointer{"name"};
    // A new JSON document for the name
    const sourcemeta::jsontoolkit::JSON name_value{"Johnny Doe"};
    // Updating the value of the name using JSON pointer
    sourcemeta::jsontoolkit::set(document, name_pointer, name_value);
    sourcemeta::jsontoolkit::prettify(document, std::cout);
    std::cout<<"\n";

    // The above program will print the following to standard output:
    //output :
    //    {
    //       "address": "zxy_with_bar",
    //       "age": 21,
    //       "name": "xyz_with_foo"
    //    }
}

Documentation

Refer to the project website for documentation: https://jsontoolkit.sourcemeta.com.

Commercial Use

This project is governed by the AGPL-3.0 copyleft license and our Contribution Agreement. To ensure the sustainability of the project, you can freely make use of this software as long the outcome is distributed under the same license. Otherwise, you must obtain a commercial license that removes such restrictions. Read more about our licensing approach here.

About

JSON Toolkit is a swiss-army knife library for expressive JSON programming in modern C++

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C++ 97.2%
  • CMake 2.2%
  • C 0.3%
  • Makefile 0.1%
  • Batchfile 0.1%
  • Shell 0.1%