|
arg_router
1.4.0
C++ command line argument parsing and routing
|
#include <arg_router/policy/custom_parser.hpp>
Public Types | |
| using | value_type = T |
| using | parser_type = std::function< value_type(std::string_view)> |
Public Member Functions | |
| constexpr | custom_parser (parser_type p) noexcept |
| template<typename ValueType , typename... Parents> | |
| constexpr ValueType | parse_phase (std::string_view token, [[maybe_unused]] const Parents &... parents) const |
Provides the ability for an argument to have a user-provided value parser.
| T | Argument's value type i.e. the type the parser needs to return |
Definition at line 20 of file custom_parser.hpp.
| using arg_router::policy::custom_parser< T >::parser_type = std::function<value_type(std::string_view)> |
Parser signature.
Definition at line 27 of file custom_parser.hpp.
| using arg_router::policy::custom_parser< T >::value_type = T |
Alias of T.
Definition at line 24 of file custom_parser.hpp.
|
inlineexplicitconstexprnoexcept |
|
inlineconstexpr |
Parse str to produce an equivalent instance of value_type.
| ValueType | Parsed value type, must be implicity convertible from value_type |
| Parents | Pack of parent tree nodes in ascending ancestry order |
| token | Token to parse |
| parents | Parents instances pack |
| multi_lang_exception | Thrown if parsing failed |
Definition at line 45 of file custom_parser.hpp.