Ecosyste.ms: Awesome

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

Awesome Lists | Featured Topics | Projects

https://github.com/timothygu/json-parser-cpp

Toy JSON parser written in C++20
https://github.com/timothygu/json-parser-cpp

Last synced: 11 days ago
JSON representation

Toy JSON parser written in C++20

Awesome Lists containing this project

README

        

# Toy C++ JSON parser

**Toy project. Do not use in production.**

This is a JSON parser written in modern C++. Here are some of the more
interesting bits of the API:

```c++
namespace json {

using Object = std::unordered_map>;
using Array = std::vector>;

class Value : public std::variant { /* ... */ };

std::optional Parse(std::string_view);
Value Clone(const Value&);

} // namespace json
```

Requires a C++ compiler that supports C++20, as well as ICU4C.

## Organization

* main.cc is a test program.
* json.h exposes a public API.
* parse.h and unicode.h contain internal utilities.