Skip to content

Add rfl::CaseInsensitiveEnums processor for case-insensitive enum parsing - #56

Closed
clockblocker wants to merge 1 commit into
mainfrom
case-insensitive-enums
Closed

clockblocker wants to merge 1 commit into
mainfrom
case-insensitive-enums

Conversation

@clockblocker

Copy link
Copy Markdown
Owner

Adds a format-agnostic rfl::CaseInsensitiveEnums processor (plus rfl::parse_enum_icase) that enables case-insensitive ASCII matching of declared enum enumerator names across any format (rfl::json::read, rfl::yaml::read, rfl::toml::read, rfl::cli::read, etc.):

  • include/rfl/CaseInsensitiveEnums.hpp: rfl::CaseInsensitiveEnums processor & rfl::parse_enum_icase helper
  • include/rfl/internal/case_insensitive_enums_v.hpp: compile-time processor trait (including nested rfl::Processors<...>)
  • include/rfl/parsing/ParserEnum.hpp: delegates to rfl::parse_enum_icase when rfl::CaseInsensitiveEnums is enabled, honoring rfl::EnumNamesOnly
  • Unit tests in tests/json/test_case_insensitive_enums.cpp and tests/cli/test_case_insensitive_enums.cpp

Verified with clang++ -std=c++23 -Wall -Wextra -Werror under ASan + UBSan.

@clockblocker

Copy link
Copy Markdown
Owner Author

Signed-off branch is preserved on fork and indexed in #116 (Easy & Landable — Parked for After Main Effort) so the open PR list tracks only the active 18-PR queue + live upstream PRs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant