An open API service indexing awesome lists of open source software.

https://github.com/yhirose/cpp-jsonlib

A C++17 single-file header-only library to wrap RapidJSON SAX interface
https://github.com/yhirose/cpp-jsonlib

cpp17 json sax-parser

Last synced: 6 months ago
JSON representation

A C++17 single-file header-only library to wrap RapidJSON SAX interface

Awesome Lists containing this project

README

          

# cpp-jsonlib

A C++17 single-file header-only library for [RapidJSON SAX interface](https://rapidjson.org/md_doc_sax.html)

```cpp
#include
#include "jsonlib.h"

int main(void) {
std::string json;
while (std::getline(std::cin, json)) {
std::string key;
jsonlib::parse(json, {
.Key = [&](auto str, auto len) {
key.assign(str, len);
},
.String = [&](auto str, auto len) {
std::cout << key << ": " << std::string(str, len) << std::endl;
}
});
}
}
```