|
welder 0.1.0
Bindings for annotated C++ types, from C++26 reflection
|
Classes | |
| struct | none |
| The identity style: bind every C++ identifier unchanged. More... | |
| struct | uniform |
| A single-convention style: reshape every kind to convention Kind, whatever the source spelling. More... | |
Concepts | |
| concept | name_style |
| A name style names every kind of entity welder can bind, through one hook per kind. | |
Typedefs | |
| using | snake_case = uniform<case_kind::snake> |
| foo_bar everywhere | |
| using | screaming_snake_case = uniform<case_kind::screaming_snake> |
| FOO_BAR everywhere | |
| using | kebab_case = uniform<case_kind::kebab> |
| foo-bar everywhere | |
| using | camel_case = uniform<case_kind::camel> |
| fooBar everywhere | |
| using | pascal_case = uniform<case_kind::pascal> |
| FooBar everywhere | |
Enumerations | |
| enum class | case_kind { snake , screaming_snake , kebab , camel , pascal } |
| The naming convention a joiner emits. More... | |
Functions | |
| consteval std::vector< std::string > | split_words (std::string_view id) |
| Split an identifier into lower-cased words, however it was spelled. | |
| consteval std::string | join_words (const std::vector< std::string > &words, case_kind kind) |
| Join already-lower-cased words in convention kind. | |
| consteval std::string | restyle (std::string_view id, case_kind kind) |
| Re-spell identifier id in convention kind, preserving any leading and trailing underscore run (_private / type_ keep their fixup underscores). | |
fooBar everywhere
Definition at line 228 of file naming.hpp.
foo-bar everywhere
Definition at line 226 of file naming.hpp.
FooBar everywhere
Definition at line 230 of file naming.hpp.
FOO_BAR everywhere
Definition at line 223 of file naming.hpp.
foo_bar everywhere
Definition at line 221 of file naming.hpp.
|
strong |
The naming convention a joiner emits.
| Enumerator | |
|---|---|
| snake | foo_bar |
| screaming_snake | FOO_BAR |
| kebab | foo-bar |
| camel | fooBar |
| pascal | FooBar |
Definition at line 100 of file naming.hpp.
|
consteval |
Join already-lower-cased words in convention kind.
| words | the lower-cased words (as from split_words). |
| kind | the convention to render. |
Definition at line 112 of file naming.hpp.
References camel, kebab, pascal, screaming_snake, and snake.
Referenced by restyle().
|
consteval |
Re-spell identifier id in convention kind, preserving any leading and trailing underscore run (_private / type_ keep their fixup underscores).
An identifier that is empty or all underscores is returned unchanged.
| id | the source identifier (any spelling). |
| kind | the target convention. |
Definition at line 157 of file naming.hpp.
References join_words(), and split_words().
Referenced by welder::naming::uniform< case_kind::snake >::in().
|
consteval |
Split an identifier into lower-cased words, however it was spelled.
Word boundaries are taken at: an underscore, hyphen or space (each a separator, consumed); a lower/digit → upper transition (fooBar → foo, bar); and the end of an acronym run, i.e. an upper followed by an upper-then-lower (HTTPServer → http, server). Digits stay attached to the preceding word (vec3 → vec3). Every emitted word is lower-cased, so a joiner controls the output casing on its own.
| id | the source identifier. |
Definition at line 63 of file naming.hpp.
Referenced by restyle().