-
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Juan Cruz Viotti <[email protected]>
- Loading branch information
Showing
415 changed files
with
10,712 additions
and
13,374 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,43 +1,10 @@ | ||
![JSON Toolkit](./assets/banner.png) | ||
Sourcemeta Core | ||
=============== | ||
|
||
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 <sourcemeta/jsontoolkit/json.h> | ||
#include <sourcemeta/jsontoolkit/jsonpointer.h> | ||
|
||
#include <sstream> | ||
#include <iostream> | ||
#include <stdlib> | ||
#include <utility> | ||
|
||
auto 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; | ||
} | ||
``` | ||
This project implements a set of foundational C++ libraries to power Sourcemeta projects. | ||
|
||
Documentation | ||
------------- | ||
|
||
Refer to the project website for documentation: | ||
[https://jsontoolkit.sourcemeta.com](https://jsontoolkit.sourcemeta.com). | ||
[https://core.sourcemeta.com](https://core.sourcemeta.com). |
Binary file not shown.
Oops, something went wrong.