Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/sourcemeta/jsontoolkit
JSON Toolkit is a swiss-army knife library for expressive JSON programming in modern C++
https://github.com/sourcemeta/jsontoolkit
cpp cxx json json-pointer json-schema jsonpointer jsonschema
Last synced: 3 months ago
JSON representation
JSON Toolkit is a swiss-army knife library for expressive JSON programming in modern C++
- Host: GitHub
- URL: https://github.com/sourcemeta/jsontoolkit
- Owner: sourcemeta
- License: agpl-3.0
- Created: 2022-12-08T00:21:56.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2024-04-13T00:11:59.000Z (10 months ago)
- Last Synced: 2024-04-13T16:36:03.797Z (10 months ago)
- Topics: cpp, cxx, json, json-pointer, json-schema, jsonpointer, jsonschema
- Language: C++
- Homepage: https://jsontoolkit.sourcemeta.com/
- Size: 1.63 MB
- Stars: 10
- Watchers: 1
- Forks: 0
- Open Issues: 8
-
Metadata Files:
- Readme: README.markdown
- Changelog: CHANGELOG.markdown
- License: LICENSE
Awesome Lists containing this project
README
![JSON Toolkit](./assets/banner.png)
JSON Toolkit is a swiss-army knife for [JSON](https://www.json.org) programming
in modern C++. It comes with a built-in parser and growing support for
standards such as [JSON Schema](http://json-schema.org), [JSON
Pointer](https://www.rfc-editor.org/rfc/rfc6901),
[JSONL](https://jsonlines.org), and more. For example:```cpp
#include
#include#include
#include
#include
#includeauto main() -> int {
// Parsing a JSON document from a string
auto document{sourcemeta::jsontoolkit::parse(R"JSON({
"name": "John Doe",
"age": 20,
"address": "14 Manchester Road, Coventry CV77 1XN"
})JSON")};// Updating a property using JSON Pointer
const sourcemeta::jsontoolkit::Pointer pointer{"name"};
sourcemeta::jsontoolkit::JSON new_value{"Jane Doe"};
sourcemeta::jsontoolkit::set(document, pointer, std::move(new_value));// Pretty-print result
sourcemeta::jsontoolkit::prettify(document, std::cout);
std::cout << "\n";return EXIT_SUCCESS;
}
```Documentation
-------------Refer to the project website for documentation:
[https://jsontoolkit.sourcemeta.com](https://jsontoolkit.sourcemeta.com).