Skip to content

Documentation

The basics

Installation
How to install reflect-cpp using vcpkg, conan, cmake or direct inclusion.
Supported formats
What formats are supported by reflect-cpp, such as JSON, XML, msgpack, etc.
Structs
Recaps the motivating example in the README.
Optional fields
For defining fields that might be absent in your serialized format.
Struct flattening
For making struct A inherit the fields of struct B.
Processors
For modifying structs before serialization and deserialization.
The rfl::Field-syntax
An alternative syntax that allows for powerful functionalities.
String literals
For representing strings that can only assume a limited number of enumerated values.
Enums
How reflect-cpp handles C++ enums.
std::variant and rfl::TaggedUnion
For structs that can be one of several formats.
rfl::Box and rfl::Ref
For defining recursive structures.
rfl::Timestamp and std::chrono::duration
For serializing and deserializing timestamps and durations.
rfl::Skip
For skipping fields during serialization and/or deserialization.
rfl::Commented
For adding comments to your serialized format.
rfl::Result
For error handling without exceptions.
Standard containers
How reflect-cpp treats containers in the standard library.
std::expected
For serializing and deserializing std::expected, the C++-23 result type.
C arrays and inheritance
How reflect-cpp handles C arrays and inheritance.
rfl::Bytestring
How reflect-cpp handles binary strings for formats that support them.
rfl::Binary, rfl::Hex and rfl::Oct
For expressing numbers in different formats.
Default values
For defining default values for fields that might be absent.
Atomic types
For serializing and deserializing atomic types.

Validation

Generic elements

Custom classes

Useful helper functions and classes

Advanced topics

Contributing