GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • reflect-cpp
  • Supported Formats
  • C++-26 reflection
  • Contributing
  • GitHub

This view

  • Original page
  • New address

GeezerVison is showing rfl.getml.com — reflect-cpp

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

Regex patterns
For requiring that strings follow user-defined regex patterns.
Validating numbers
For imposing constraints on numbers.
Composing validators
For defining more complex validators using operators.
Size validation
For imposing size constraints on containers.
JSON schema
For validating your schema before you send it to your C++ backend.

Generic elements

rfl::Object
A map-like type representing an object with unknown field names.
rfl::Generic
A catch-all type that can represent almost anything.
rfl::ExtraFields
For adding extra fields with unknown names.

Custom classes

Custom classes
For custom classes with private fields.
Custom parsers for your classes
For custom classes that you want to leave untouched.

Useful helper functions and classes

rfl::replace
For replacing one or several fields in a struct.
rfl::as
For casting structs as other structs.
rfl::NamedTuple
For structural typing.
rfl::Tuple
An alternative to std::tuple that compiles more quickly.
rfl::to_view
For accessing fields of a struct by index or name.

Advanced topics

Supporting your own format
For supporting your own serialization and deserialization formats.
Maintaining backwards compatibility
Instructions for ensuring backwards-compatible APIs.
Benchmarks
Extensive benchmarks of popular serialization libraries.

Contributing

How to contribute
How to contribute to reflect-cpp.
Build the documentation
How to build the documentation locally.
You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.