|
cli20 0.1.2
A C++20 typed-schema command-line parser
|
Actions that convert a raw std::string_view token to a typed value. More...
Classes | |
| struct | Integer |
| Converts a string token to an integral type T using std::from_chars. More... | |
| struct | Floating |
| Converts a string token to a floating-point type T using std::from_chars. More... | |
| struct | String |
| Converts a string_view token to a std::string by copying. More... | |
| struct | Bool |
| Converts a string token to bool. More... | |
| struct | Path |
| Converts a string token to std::filesystem::path without filesystem validation. More... | |
| struct | ExistingFile |
| Converts a string token to std::filesystem::path, requiring the path to exist and be a regular file. More... | |
| struct | ExistingDirectory |
| Converts a string token to std::filesystem::path, requiring the path to exist and be a directory. More... | |
| struct | Choice |
| Converts a string token to type T via a user-supplied mapper function. More... | |
| struct | NegatableResult |
| Result of the negatable<> conversion. More... | |
| struct | Negatable |
| Converts a string token to NegatableResult by detecting a compile-time negation prefix. More... | |
| struct | DefaultMissingValue |
| Injects a compile-time default value when an option is invoked as a flag (no value provided). More... | |
Typedefs | |
| template<class T, auto Mapper> | |
| using | Enumeration = Choice<T, Mapper> |
Functions | |
| template<std::size_t I> | |
| auto | get (NegatableResult &r) -> decltype(auto) |
| template<std::size_t I> | |
| auto | get (const NegatableResult &r) -> decltype(auto) |
Variables | |
| template<std::integral T> | |
| constexpr auto | integer = Action<Integer<T>{}>{} |
| template<std::floating_point T> | |
| constexpr auto | floating = Action<Floating<T>{}>{} |
| template<class T, auto Mapper> | |
| constexpr auto | choice = Action<Choice<T, Mapper>{}>{} |
| template<class T, auto Mapper> | |
| constexpr auto | enumeration = Action<Enumeration<T, Mapper>{}>{} |
| template<StringLiteral Prefix> | |
| constexpr auto | negatable = Action<Negatable<Prefix>{}>{} |
| constexpr auto | string = Action<String{}>{} |
| constexpr auto | boolean = Action<Bool{}>{} |
| constexpr auto | path = Action<Path{}>{} |
| constexpr auto | existing_file = Action<ExistingFile{}>{} |
| constexpr auto | existing_directory = Action<ExistingDirectory{}>{} |
| template<StringLiteral Value> | |
| constexpr auto | default_missing_value |
Actions that convert a raw std::string_view token to a typed value.
Each action in this namespace transforms the pipeline value from a string representation into a specific C++ type. They are typically placed first in an action pipeline, before validation and pack actions.
Example:
| using cli::conversion::Enumeration = Choice<T, Mapper> |
| auto cli::conversion::get | ( | const NegatableResult & | r | ) | -> decltype(auto) |
| auto cli::conversion::get | ( | NegatableResult & | r | ) | -> decltype(auto) |
|
inlineconstexpr |
|
inlineconstexpr |
|
inlineconstexpr |
|
inlineconstexpr |
|
inlineconstexpr |