reflective-rapidjson/README.md

63 lines
2.0 KiB
Markdown
Raw Normal View History

# reflective-rapidjson
2017-10-24 18:00:51 +02:00
The main goal of this project is to provide a code generator for serializing/deserializing C++ objects to/from JSON
using Clang and RapidJSON.
However, extending the generator to generate code for other applications of reflection or to provide generic
reflection functionallity would be possible as well.
This repository also contains a small, additional header to use RapidJSON with Boost.Hana. This allows to serialize
or dezerialize simple data structures using the `BOOST_HANA_DEFINE_STRUCT` macro rather than requiring the code
generator.
2017-10-24 18:00:51 +02:00
## Usage
This example shows how the library can be used to make a `struct` serializable:
```
TODO
```
Note that the header included at the bottom must be generated by invoking the code generator appropriately:
```
TODO
```
It is possible to use the provided CMake macro to automate this task:
```
TODO
```
### Using Boost.Hana instead of code generator
The same example as above. However, this time Boost.Hana is used. So it doesn't required to invoking the generator.
```
TODO
```
## Install instructions
### Dependencies
* C++ compiler and standard library supporting at least C++14
* the CMake build system
* LibTooling from Clang for the code generator
* RapidJSON for JSON (de)serialization
2017-10-25 19:25:27 +02:00
* Boost.Hana for using `BOOST_HANA_DEFINE_STRUCT` instead of code generator
2017-10-24 18:00:51 +02:00
* `c++utilities` for various helper functions
Optional:
* CppUnit for building and running the tests
* Doxygen for generating API documentation
* Graphviz for diagrams in the API documentation
Note that `reflective-rapidjson` and none of these dependencies are required at runtime by an application which
makes use of the `reflective-rapidjson`.
### How to build
Install all required dependencies and ensure the CMake script finds them. It is possible to build `c++utilities`
together `reflective-rapidjson` to ease the build process. The following build script makes use of this. To use
system `c++utilities`, just skip any lines with `c++utilities` in it.
```
TODO
```