Minor improvements to the documentation (#327)

This commit is contained in:
Dr. Patrick Urbanke (劉自成)
2025-01-06 18:20:00 +01:00
committed by GitHub
parent 1b60b09de8
commit cabd5ee7a4
14 changed files with 36 additions and 15 deletions
+2
View File
@@ -149,6 +149,7 @@ and any supported format, except where explicitly noted otherwise:
```cpp
rfl::avro::write(homer);
rfl::bson::write(homer);
rfl::capnproto::write(homer);
rfl::cbor::write(homer);
rfl::flexbuf::write(homer);
rfl::msgpack::write(homer);
@@ -158,6 +159,7 @@ rfl::xml::write(homer);
rfl::avro::read<Person>(avro_bytes);
rfl::bson::read<Person>(bson_bytes);
rfl::capnproto::read<Person>(capnproto_bytes);
rfl::cbor::read<Person>(cbor_bytes);
rfl::flexbuf::read<Person>(flexbuf_bytes);
rfl::msgpack::read<Person>(msgpack_bytes);
+2 -2
View File
@@ -44,7 +44,7 @@
[Size validation](size_validation.md) - For imposing size constraints on containers such as `std::vector` or `std::string`.
[JSON schema](supported_formats/json_schema.md) - For validating your schema before you even send it to your C++ backend.
[JSON schema](json_schema.md) - For validating your schema before you even send it to your C++ backend.
## Generic elements
@@ -80,4 +80,4 @@
[Benchmarks](benchmarks.md) - Extensive benchmarks of popular libraries for serialization, deserialization.
<br>
<br>
+2 -1
View File
@@ -1,6 +1,7 @@
# Avro
For Avro support, you must also include the header `<rfl/avro.hpp>` and link to the `avro-c` library (https://avro.apache.org/docs/1.6.3/api/c/index.html).
For Avro support, you must also include the header `<rfl/avro.hpp>` and link to the [avro-c](https://avro.apache.org/docs/1.11.1/api/c/) library.
Furthermore, when compiling reflect-cpp, you need to pass `-DREFLECTCPP_AVRO=ON` to cmake.
Avro is a schemaful binary format. This sets it apart from most other formats supported by reflect-cpp, which are schemaless.
+3 -1
View File
@@ -1,6 +1,8 @@
# BSON
For BSON support, you must also include the header `<rfl/bson.hpp>` and link to the libbson library (https://github.com/mongodb/libbson).
For BSON support, you must also include the header `<rfl/bson.hpp>` and link to the [libbson](https://github.com/mongodb/mongo-c-driver) library.
Furthermore, when compiling reflect-cpp, you need to pass `-DREFLECTCPP_BSON=ON` to cmake. If you are using vcpkg, there
should be an appropriate feature that will abstract this away for you.
Like the name implies, BSON is a JSON-like binary format. It is most notably used by MongoDB.
+2 -2
View File
@@ -1,8 +1,8 @@
# Cap'n Proto
For Cap'n Proto support, you must also include the header `<rfl/capnproto.hpp>` and link to the capnproto library (https://capnproto.org).
For Cap'n Proto support, you must also include the header `<rfl/capnproto.hpp>` and link to the [capnproto](https://capnproto.org) library.
Furthermore, when compiling reflect-cpp, you need to pass `-DREFLECTCPP_CAPNPROTO=ON` to cmake. If you are using vcpkg or Conan, there
should be an appropriate feature (vcpkg) or options that will abstract this away for you.
should be an appropriate feature (vcpkg) or option (Conan) that will abstract this away for you.
Cap'n Proto is a schemaful binary format. This sets it apart from most other formats supported by reflect-cpp, which are schemaless.
+3 -1
View File
@@ -1,6 +1,8 @@
# CBOR
For CBOR support, you must also include the header `<rfl/cbor.hpp>` and include the jsoncons library (https://github.com/danielaparker/jsoncons). Note that it is header-only.
For CBOR support, you must also include the header `<rfl/cbor.hpp>` and include the [jsoncons](https://github.com/danielaparker/jsoncons) library.
Note that it is header-only. Furthermore, when compiling reflect-cpp, you need to pass `-DREFLECTCPP_CBOR=ON` to cmake. If you are using vcpkg or Conan, there
should be an appropriate feature (vcpkg) or option (Conan) that will abstract this away for you.
CBOR or Concise Binary Object Representation, is a JSON-like binary format with an emphasis on small binary sizes.
+3 -1
View File
@@ -1,6 +1,8 @@
# Flexbuffers
For flexbuffers support, you must also include the header `<rfl/flexbuf.hpp>` and link to the flatbuffers library (https://github.com/google/flatbuffers).
For flexbuffers support, you must also include the header `<rfl/flexbuf.hpp>` and link to the [flatbuffers](https://github.com/google/flatbuffers) library.
Furthermore, when compiling reflect-cpp, you need to pass `-DREFLECTCPP_FLEXBUFFERS=ON` to cmake. If you are using vcpkg or Conan, there
should be an appropriate feature (vcpkg) or option (Conan) that will abstract this away for you.
Flexbuffers is part of the flatbuffers library, which is a binary format developed by Google.
+3 -1
View File
@@ -1,6 +1,8 @@
# msgpack
For msgpack support, you must also include the header `<rfl/msgpack.hpp>` and link to the msgpack-c library (https://github.com/msgpack/msgpack-c).
For msgpack support, you must also include the header `<rfl/msgpack.hpp>` and link to the [msgpack-c](https://github.com/msgpack/msgpack-c) library.
Furthermore, when compiling reflect-cpp, you need to pass `-DREFLECTCPP_MSGPACK=ON` to cmake. If you are using vcpkg or Conan, there
should be an appropriate feature (vcpkg) or option (Conan) that will abstract this away for you.
msgpack is a JSON-like binary format with an emphasis on small binary sizes.
+4 -1
View File
@@ -1,6 +1,9 @@
# TOML
For TOML support, you must also include the header `<rfl/toml.hpp>` and include the toml++ library (https://github.com/marzer/tomlplusplus) in your project.
For TOML support, you must also include the header `<rfl/toml.hpp>` and include the [toml++](https://github.com/marzer/tomlplusplus) library.
Furthermore, when compiling reflect-cpp, you need to pass `-DREFLECTCPP_TOML=ON` to cmake. If you are using vcpkg or Conan, there
should be an appropriate feature (vcpkg) or option (Conan) that will abstract this away for you.
## Reading and writing
+3 -1
View File
@@ -1,6 +1,8 @@
# UBJSON
For UBJSON support, you must also include the header `<rfl/ubjson.hpp>` and include the jsoncons library (https://github.com/danielaparker/jsoncons). Note that it is header-only.
For UBJSON support, you must also include the header `<rfl/ubjson.hpp>` and include the [jsoncons](https://github.com/danielaparker/jsoncons) library.
Note that it is header-only. Furthermore, when compiling reflect-cpp, you need to pass `-DREFLECTCPP_UBJSON=ON` to cmake. If you are using vcpkg or Conan, there
should be an appropriate feature (vcpkg) or option (Conan) that will abstract this away for you.
UBJSON is a JSON-like binary format.
+4 -1
View File
@@ -1,6 +1,9 @@
# XML
For XML support, you must also include the header `<rfl/xml.hpp>` and include the pugixml library (https://github.com/zeux/pugixml) in your project.
For XML support, you must also include the header `<rfl/xml.hpp>` and include the [pugixml](https://github.com/zeux/pugixml) library.
Furthermore, when compiling reflect-cpp, you need to pass `-DREFLECTCPP_XML=ON` to cmake. If you are using vcpkg or Conan, there
should be an appropriate feature (vcpkg) or option (Conan) that will abstract this away for you.
## Simple example
+4 -1
View File
@@ -1,6 +1,9 @@
# YAML
For YAML support, you must also include the header `<rfl/yaml.hpp>` and include the yaml-cpp library (https://github.com/jbeder/yaml-cpp) in your project.
For YAML support, you must also include the header `<rfl/yaml.hpp>` and include the [yaml-cpp](https://github.com/jbeder/yaml-cpp) library.
Furthermore, when compiling reflect-cpp, you need to pass `-DREFLECTCPP_YAML=ON` to cmake. If you are using vcpkg or Conan, there
should be an appropriate feature (vcpkg) or option (Conan) that will abstract this away for you.
## Reading and writing
+1 -2
View File
@@ -98,7 +98,6 @@ nav:
- CBOR: supported_formats/cbor.md
- FlexBuffers: supported_formats/flexbuffers.md
- JSON: supported_formats/json.md
- JSON Schema: supported_formats/json_schema.md
- MessagePack: supported_formats/msgpack.md
- TOML: supported_formats/toml.md
- UBJSON: supported_formats/ubjson.md
@@ -131,7 +130,7 @@ nav:
- Validating numbers: validating_numbers.md
- Composing validators: composing_validators.md
- Size validation: size_validation.md
- JSON schema: supported_formats/json_schema.md
- JSON schema: json_schema.md
- Generic elements:
- rfl::Object: object.md
- rfl::Generic: generic.md