From c0e65708480065c1734c6481e71784d8be9bf6e2 Mon Sep 17 00:00:00 2001 From: Martchus Date: Sun, 29 Oct 2017 23:46:11 +0100 Subject: [PATCH] Document supported datatypes --- README.md | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/README.md b/README.md index ae7b842..a76b2d3 100644 --- a/README.md +++ b/README.md @@ -10,6 +10,29 @@ This repository also contains a small, additional header to use RapidJSON with B or dezerialize simple data structures using the `BOOST_HANA_DEFINE_STRUCT` macro rather than requiring the code generator. +## Supported datatypes +The following table shows the mapping of supported C++ types to supported JSON types: + +| C++ type | JSON type | +| ---------------------------------------- |:---------:| +| custom structures/classes | object | +| bool | true/false| +| signed and unsigned integral types | number | +| float and double | number | +| enum and enum class | number | +| std::string | string | +| const char * | string | +| iteratables (std::vector, std::list, ...)| array | +| std::tuple | array | + +### Remarks +* `const char *` is only supported for serialization. +* Enums are only supported for serialization. +* For deserialization, iteratables must provide an `emplace_back` method. So deserialization of eg. `std::forward_list` + is currently not supported. +* Using pointers is not supported yet. +* The JSON type `null` is not supported yet. + ## Usage This example shows how the library can be used to make a `struct` serializable: ```