Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
e5c6053
fix(validation): fix rfl::OneOf broken .and_then().or_else() composition
clockblocker Nov 29, 2026
89c3661
fix(json): reject uint64 > INT64_MAX instead of silently wrapping int…
clockblocker Nov 28, 2026
b9dc1e9
feat(json-schema): emit oneOf for rfl::TaggedUnion in JSON Schema (#375)
clockblocker Nov 29, 2026
07ef2b6
fix(headers): eliminate -Wextra, -Wextra-semi, -Wsign-conversion, and…
clockblocker Nov 27, 2026
4879f7e
fix(parsing): gate <expected> include behind <version> feature test t…
clockblocker Nov 30, 2026
d9ae712
feat(enums): accept std::string_view in rfl::string_to_enum (#565)
clockblocker Nov 27, 2026
b14e27d
perf(headers): trim <functional>, <sstream>, and unused <map> from th…
clockblocker Nov 28, 2026
6b4a388
fix(yaml): guard rfl::yaml::Reader against recursive aliases and out-…
clockblocker Nov 25, 2026
489eba4
fix(yaml): reject negative-to-unsigned wraparound, narrow integer ove…
clockblocker Nov 29, 2026
79b1268
fix(xml): fix get_field_from_array index increment and write() indent…
clockblocker Nov 27, 2026
4e25859
fix(env): use getenv_s and _dupenv_s under _MSC_VER in rfl::env::Reader
clockblocker Nov 30, 2026
c7aa574
fix(yaml): return error on non-scalar mapping keys instead of silentl…
clockblocker Nov 29, 2026
970f78f
fix(parsing): prevent std::terminate() at noexcept validation, map-ke…
clockblocker Nov 29, 2026
f49d6c8
fix(parsing): capture input keys matching ExtraFields member name
clockblocker Nov 29, 2026
d8892d9
docs(licensing): add THIRD_PARTY_NOTICES for vendored dependencies
clockblocker Nov 29, 2026
ff639f3
fix(enums): backport enchantum MSVC 64-bit enum cast suffix fix
clockblocker Nov 30, 2026
04495b8
fix(json-schema): flatten nested anyOf for optional variants and rfl:…
clockblocker Nov 29, 2026
b9081d0
feat(cli): add rfl::cli::usage to generate usage and help text (#692)
clockblocker Nov 29, 2026
fc9f041
feat(json): add first-class rfl::json read and write flag constants
clockblocker Nov 29, 2026
54c89d2
perf(parsing): isolate per-field helpers in NamedTupleParser, destruc…
clockblocker Nov 29, 2026
a2d46af
perf(internal): add apply_to_fields and avoid NamedTuple in HasDefaul…
clockblocker Nov 29, 2026
dc6fcc6
fix(error): preserve structured Error::details() paths in FieldVarian…
clockblocker Nov 29, 2026
76da80d
perf(internal): use O(log N) exponential + binary search in cpp20::nu…
clockblocker Nov 29, 2026
0ac0ee2
perf(parsing): isolate per-field helpers in ViewReader and ViewReader…
clockblocker Nov 29, 2026
9a5ee9b
feat(enums): add rfl::TransformEnumNames processors (#731)
clockblocker Nov 29, 2026
950382b
feat(reflection): add public rfl::type_name<T>() and rfl::type_name_v<T>
clockblocker Nov 29, 2026
8bc0da9
perf(schema): fast-path scalar defaults in NamedTupleParser::to_schema
clockblocker Nov 29, 2026
8bb958f
feat(json-schema): add rfl::IntegerBounds opt-in processor (#683)
clockblocker Nov 29, 2026
5d8a835
fix(schema): cast char to unsigned char for std::isalnum and add miss…
clockblocker Nov 29, 2026
68161ed
feat(reflection): expose public rfl::StringLiteral header and constex…
clockblocker Nov 29, 2026
698a622
feat(json-schema): add rfl::VariantsAsOneOf opt-in processor (#375)
clockblocker Nov 29, 2026
c840569
perf(parsing): add FieldNameLookup cursor-hint and binary-search fiel…
clockblocker Nov 29, 2026
6648678
fix(schema): unwrap Type::Description and Type::Deprecated in Avro an…
clockblocker Nov 29, 2026
d7c8d1c
feat(enums): add rfl::EnumNames<E> per-enum wire-name trait (#106)
clockblocker Nov 29, 2026
abc8516
feat(json): add rfl::json::Raw for passthrough raw JSON values (#368)
clockblocker Nov 29, 2026
b640722
build(cmake): subproject ergonomics, CMake 3.20 support, warning/lint…
clockblocker Nov 30, 2026
9b382c6
build(cmake): isolate bundled yyjson visibility, support external yyj…
clockblocker Nov 30, 2026
e562074
feat(schema): add opt-in zero-bloat rfl::Metadata<T> for out-of-band …
clockblocker Nov 30, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
652 changes: 509 additions & 143 deletions CMakeLists.txt

Large diffs are not rendered by default.

44 changes: 42 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,12 @@ reflect-cpp and sqlgen fill important gaps in C++ development. They reduce boile
- [Extra fields](#extra-fields)
- [Reflective programming](#reflective-programming)
- [Standard Library Integration](#support-for-containers)
- [Installation](#installation)
- [The team behind reflect-cpp](#the-team-behind-reflect-cpp)
- [License](#license)

### More in our [documentation](https://munich-data-engineering.github.io/reflect-cpp):
- [Installation ↗](https://munich-data-engineering.github.io/reflect-cpp/install/#option-2-compilation-using-cmake)
- [Installation ↗](https://munich-data-engineering.github.io/reflect-cpp/install/#option-3-compilation-using-cmake)
- [C++26 reflection ↗](https://munich-data-engineering.github.io/reflect-cpp/cpp26_reflection)
- [Benchmarks ↗](https://munich-data-engineering.github.io/reflect-cpp/benchmarks)
- [How to contribute ↗](https://munich-data-engineering.github.io/reflect-cpp/contributing)
Expand Down Expand Up @@ -373,6 +374,17 @@ struct Config {
// ./app data.csv -o /tmp/out -v --count=10
```

`rfl::cli::usage` generates the help text from the same struct, for instance for `--help`:

```cpp
if (argc > 1 && std::string_view(argv[1]) == "--help") {
std::cout << rfl::cli::usage<Config>(argv[0], true).value();
// Usage: ./app <input-file> -o|--output-dir=<value> -v|--verbose[=<bool>] --count=<value>
//
// Arguments: ...
}
```

Nested structs, `std::optional`, `std::vector`, enums, `rfl::Flatten` and `rfl::Rename` are all supported. Refer to the [documentation](https://munich-data-engineering.github.io/reflect-cpp/cli) for details.

### Error messages
Expand Down Expand Up @@ -426,6 +438,8 @@ The resulting JSON schema looks like this:

Note that this is currently supported for JSON only, since most other formats do not support schemata in the first place.

If you prefer not to embed long description strings into your field types, you can also attach struct-level and per-field descriptions and deprecation messages out of band by specializing `rfl::Metadata<T>` ([details](https://munich-data-engineering.github.io/reflect-cpp/json_schema/#out-of-band-metadata-rflmetadata)).

### Enums

reflect-cpp supports scoped enumerations:
Expand Down Expand Up @@ -671,6 +685,7 @@ In addition, it supports the following custom containers:
- `rfl::Tuple`: An alternative to `std::tuple` that compiles considerably faster.
- `rfl::Validator`: Allows for automatic input validation.
- `rfl::Variant`: An alternative to `std::variant` that compiles considerably faster.
- `rfl::json::Raw`: Holds a raw JSON value for passthrough serialization and deserialization (JSON only; [details](https://munich-data-engineering.github.io/reflect-cpp/supported_formats/json/#raw-json-passthrough-rfljsonraw)).

#### Custom classes

Expand All @@ -687,6 +702,29 @@ The following compilers are supported for C++-20:
The following compilers are supported for C++-26:
- GCC 16.2 or higher

### Using CMake FetchContent

JSON-only (zero external dependencies — `yyjson`, `ctre`, and `enchantum` are bundled):

```cmake
include(FetchContent)
FetchContent_Declare(reflectcpp
GIT_REPOSITORY https://github.com/munich-data-engineering/reflect-cpp.git
GIT_TAG main # replace with a release tag containing CMake 3.20 / subproject support
GIT_SHALLOW TRUE
GIT_SUBMODULES "")
FetchContent_MakeAvailable(reflectcpp)
target_link_libraries(your_project PRIVATE reflectcpp::reflectcpp)
```

To enable additional formats (for example YAML), set the corresponding `REFLECTCPP_*` option **before** `FetchContent_MakeAvailable(reflectcpp)` (non-JSON format libraries are resolved via `find_package` from system packages, vcpkg, or Conan because `REFLECTCPP_USE_VCPKG` defaults to `OFF` when consumed as a subproject):

```cmake
set(REFLECTCPP_YAML ON)
FetchContent_MakeAvailable(reflectcpp)
target_link_libraries(your_project PRIVATE reflectcpp::reflectcpp)
```

### Using vcpkg

https://vcpkg.io/en/package/reflectcpp
Expand Down Expand Up @@ -722,7 +760,7 @@ cmake --build build -j 4 # gcc, clang
cmake --build build --config Release -j 4 # MSVC
```

For other installation methods, refer to the [documentation](https://munich-data-engineering.github.io/reflect-cpp/docs-readme).
For other installation methods, refer to the [documentation](https://munich-data-engineering.github.io/reflect-cpp/install).

### Compiling with C++-26 reflection

Expand Down Expand Up @@ -752,3 +790,5 @@ reflect-cpp includes [YYJSON](https://github.com/ibireme/yyjson), the fastest JS
reflect-cpp includes [compile-time-regular-expressions](https://github.com/hanickadot/compile-time-regular-expressions). CTRE is written by Hana Dusíková and released under the Apache-2.0 License with LLVM exceptions.

reflect-cpp includes [enchantum](https://github.com/ZXShady/enchantum/tree/main). enchantum is written by ZXShady and also released under the MIT License.

See [THIRD_PARTY_NOTICES.md](THIRD_PARTY_NOTICES.md) for full third-party license texts, SPDX identifiers, and CMake/feature inclusion conditions.
Loading
Loading