Incredibly simple JSON parser in C++
Example usage
auto json_str = R"({"hello": "world"}")";
auto json = parser.
parse(json_str).expect(
"parse");
std::string hello = json["hello"];
printf("Hello, %s!\n", hello.c_str());
A JSON parsing class for converting JSON strings to JsonValue objects.
Definition brace.h:363
Result< JsonValue, ParseError > parse(const std::string &json)
Parses a JSON-formatted string into a JsonValue.
Getting Started
A C++ compiler with at least support for C++17 is required. The easiest way to get started is by adding CPM.cmake to your project:
include(cmake/CPM.cmake)
CPMAddPackage("gh:twct/brace#git_tag_or_rev_sha")
target_link_libraries(MyTarget PRIVATE brace)
Build & run unit tests
$ mkdir build && cd build
$ cmake -G Ninja -DBRACE_BUILD_TESTS=on ..
$ ninja && ninja test
Build docs
$ cd docs && make
# bundle as zip
$ make zip