https://github.com/severindenisenko/json
My json for C++ 23
https://github.com/severindenisenko/json
Last synced: about 2 months ago
JSON representation
My json for C++ 23
- Host: GitHub
- URL: https://github.com/severindenisenko/json
- Owner: SeverinDenisenko
- Created: 2023-03-22T19:27:44.000Z (about 2 years ago)
- Default Branch: master
- Last Pushed: 2023-03-24T06:27:01.000Z (about 2 years ago)
- Last Synced: 2025-02-01T21:16:01.670Z (4 months ago)
- Language: C++
- Size: 21.5 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# JSON for C++23
## Dependencies
No external Dependencies!
## Adding to your project
```cmake
add_subdirectory(json)
include_directories(json/include)
```## Creation
```c++
Json json = JsonObject();json["hello"] = 123.0;
json["json"] = true;
json["for"] = "modern C++";json["nested"] = JsonObject();
json["nested"]["objects"] = JsonArray();
json["nested"]["objects"].push_back(JsonObject());
json["nested"]["objects"][0] = "and arrays";
```## Output
```c++
Writer writer("output.json");
writer.Write(json);
```## Input
```c++
Parser parser("input.json");
Json json = parser.Parse();
```