arg_router
1.4.0
C++ command line argument parsing and routing
|
#include <arg_router/policy/short_form_expander.hpp>
Public Member Functions | |
template<typename ProcessedTarget , typename... Parents> | |
parsing::pre_parse_result | pre_parse_phase (parsing::dynamic_token_adapter &tokens, [[maybe_unused]] utility::compile_time_optional< ProcessedTarget > processed_target, [[maybe_unused]] parsing::parse_target &target, [[maybe_unused]] const Parents &... parents) const |
Static Public Attributes | |
constexpr static auto | priority = std::size_t{900} |
Policy implementing a pre-parse phase that expands a collapsed short-form raw token into multiple parsing::token_type instances.
This is provided for node implementers, so this behaviour can be re-used amongst flag-like nodes - library users should not use it (you will likely break your node's parsing behaviour if it has a short name policy).
Definition at line 24 of file short_form_expander.hpp.
|
inline |
Performs the expansion in the pre-parse phase.
Checks if the token's first character matches the owning node's short name. If there isn't a match or the owner does not have short name policy then it just returns false. Otherwise all the characters in the token are converted into short form tokens, added to tokens.
ProcessedTarget | processed_target payload type |
Parents | Pack of parent tree nodes in ascending ancestry order |
tokens | Currently processed tokens |
processed_target | Previously processed parse_target of parent node, or empty is there is no non-root parent |
target | Pre-parse generated target |
parents | Parent node instances |
Definition at line 49 of file short_form_expander.hpp.
|
staticconstexpr |
Policy priority.
Definition at line 28 of file short_form_expander.hpp.