Skip to content

Commit

Permalink
Minor improvements to the documentation (#327)
Browse files Browse the repository at this point in the history
  • Loading branch information
liuzicheng1987 authored Jan 6, 2025
1 parent 1b60b09 commit cabd5ee
Show file tree
Hide file tree
Showing 14 changed files with 36 additions and 15 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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);
Expand Down
4 changes: 2 additions & 2 deletions docs/docs-readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -80,4 +80,4 @@

[Benchmarks](benchmarks.md) - Extensive benchmarks of popular libraries for serialization, deserialization.

<br>
<br>
File renamed without changes.
3 changes: 2 additions & 1 deletion docs/supported_formats/avro.md
Original file line number Diff line number Diff line change
@@ -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.

Expand Down
4 changes: 3 additions & 1 deletion docs/supported_formats/bson.md
Original file line number Diff line number Diff line change
@@ -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.

Expand Down
4 changes: 2 additions & 2 deletions docs/supported_formats/capnproto.md
Original file line number Diff line number Diff line change
@@ -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.

Expand Down
4 changes: 3 additions & 1 deletion docs/supported_formats/cbor.md
Original file line number Diff line number Diff line change
@@ -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.

Expand Down
4 changes: 3 additions & 1 deletion docs/supported_formats/flexbuffers.md
Original file line number Diff line number Diff line change
@@ -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.

Expand Down
4 changes: 3 additions & 1 deletion docs/supported_formats/msgpack.md
Original file line number Diff line number Diff line change
@@ -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.

Expand Down
5 changes: 4 additions & 1 deletion docs/supported_formats/toml.md
Original file line number Diff line number Diff line change
@@ -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

Expand Down
4 changes: 3 additions & 1 deletion docs/supported_formats/ubjson.md
Original file line number Diff line number Diff line change
@@ -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.

Expand Down
5 changes: 4 additions & 1 deletion docs/supported_formats/xml.md
Original file line number Diff line number Diff line change
@@ -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

Expand Down
5 changes: 4 additions & 1 deletion docs/supported_formats/yaml.md
Original file line number Diff line number Diff line change
@@ -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

Expand Down
3 changes: 1 addition & 2 deletions mkdocs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit cabd5ee

Please sign in to comment.