arg_router
1.4.0
C++ command line argument parsing and routing
|
Namespaces | |
help_formatter_component | |
validation | |
Classes | |
class | alias_t |
class | custom_parser |
class | default_help_formatter_t |
class | default_value |
class | dependent_t |
class | description_t |
class | display_name_t |
class | error_name_t |
struct | flatten_help_t |
class | long_name_t |
class | min_max_count_t |
class | min_max_value_t |
class | min_max_value_ct |
class | multi_stage_value |
struct | has_multi_stage_value |
struct | no_result_value |
class | none_name_t |
struct | is_policy |
struct | is_all_policies |
struct | has_pre_parse_phase_method |
struct | has_parse_phase_method |
struct | has_validation_phase_method |
struct | has_routing_phase_method |
struct | has_missing_phase_method |
struct | has_priority |
class | nearest_mode_like |
class | program_addendum_t |
class | program_intro_t |
class | program_name_t |
class | program_version_t |
class | required_t |
class | router |
class | runtime_enable |
class | short_form_expander_t |
class | short_name_t |
class | token_end_marker_t |
class | value_separator_t |
Typedefs | |
template<typename Indent = traits::integral_constant<std::size_t{4}>, typename DescColumnOffset = traits::integral_constant<Indent{} * 2>, typename PreambleFormatter = help_formatter_component::default_preamble_formatter, typename AddendumFormatter = help_formatter_component::default_addendum_formatter> | |
using | colour_help_formatter_t = default_help_formatter_t< Indent, DescColumnOffset, help_formatter_component::colour_line_formatter< Indent{}>, PreambleFormatter, AddendumFormatter > |
template<typename T > | |
using | has_no_result_value = std::is_base_of< no_result_value<>, T > |
template<typename T > | |
using | is_required = std::is_base_of< required_t<>, T > |
Functions | |
template<typename... AliasedPolicies> | |
constexpr auto | alias (AliasedPolicies... policies) noexcept |
template<typename... DependsPolicies> | |
constexpr auto | dependent (DependsPolicies... policies) noexcept |
template<typename ValueType , typename LessThanCompare = std::less<ValueType>> | |
constexpr auto | min_max_value (ValueType &&min, ValueType &&max, LessThanCompare &&compare=LessThanCompare{}) noexcept |
template<typename ValueType , typename LessThanCompare = std::less<ValueType>> | |
constexpr auto | min_value (ValueType &&min, LessThanCompare &&compare=LessThanCompare{}) noexcept |
template<typename ValueType , typename LessThanCompare = std::less<ValueType>> | |
constexpr auto | max_value (ValueType &&max, LessThanCompare &&compare=LessThanCompare{}) noexcept |
template<auto Min, auto Max> | |
constexpr auto | min_max_value () noexcept |
template<auto Min> | |
constexpr auto | min_value () noexcept |
template<auto Max> | |
constexpr auto | max_value () noexcept |
Variables | |
constexpr auto | colour_help_formatter = colour_help_formatter_t<>{} |
constexpr auto | default_help_formatter = default_help_formatter_t<>{} |
template<typename S > | |
constexpr auto | description = description_t<S>{} |
template<typename S > | |
constexpr auto | display_name = display_name_t<S>{} |
template<typename S > | |
constexpr auto | error_name = error_name_t<S>{} |
template<typename TranslationType , typename FallbackTranslationType = default_error_code_translations> | |
constexpr auto | exception_translator |
constexpr auto | flatten_help = flatten_help_t<>{} |
template<typename S > | |
constexpr auto | long_name = long_name_t<S>{} |
template<std::size_t MinValue, std::size_t MaxValue> | |
constexpr auto | min_max_count |
template<std::size_t Value> | |
constexpr auto | min_count |
template<std::size_t Value> | |
constexpr auto | max_count |
template<std::size_t Value> | |
constexpr auto | fixed_count |
template<typename T > | |
constexpr bool | has_multi_stage_value_v = has_multi_stage_value<T>::value |
template<typename T > | |
constexpr bool | has_no_result_value_v = has_no_result_value<T>::value |
template<typename S > | |
constexpr auto | none_name = none_name_t<S>{} |
template<typename T > | |
constexpr auto | is_policy_v = is_policy<T>::value |
template<typename Tuple > | |
constexpr auto | is_all_policies_v = is_all_policies<Tuple>::value |
template<typename S > | |
constexpr auto | program_addendum = program_addendum_t<S>{} |
template<typename S > | |
constexpr auto | program_intro = program_intro_t<S>{} |
template<typename S > | |
constexpr auto | program_name = program_name_t<S>{} |
template<typename S > | |
constexpr auto | program_version = program_version_t<S>{} |
constexpr auto | required = required_t<>{} |
template<typename T > | |
constexpr bool | is_required_v = is_required<T>::value |
constexpr auto | short_form_expander = short_form_expander_t<>{} |
template<char S> | |
constexpr auto | short_name = short_name_t<AR_STRING(S)>{} |
template<typename S > | |
constexpr auto | short_name_utf8 = short_name_t<S>{} |
template<typename S > | |
constexpr auto | token_end_marker = token_end_marker_t<S>{} |
template<char S> | |
constexpr auto | value_separator = value_separator_t<AR_STRING(S)>{} |
template<typename S > | |
constexpr auto | value_separator_utf8 = value_separator_t<S>{} |
Exception message translator policy.
Provides the mapping between the internal multi_lang_exception error code to a translated string, and then re-throws with a parse_exception.
If no matching translation string can be found, an parse_exception is thrown with a message of the form:
TranslationType | multi_lang::translation type for the current language |
FallbackTranslationType | multi_lang::translation type to use as a fall back language if a matching error_code is not found in TranslationType. Set to void if no fallback is required |
Policy namespace.
arg_router uses policies to compose behaviours on command line argument types.
using arg_router::policy::colour_help_formatter_t = typedef default_help_formatter_t<Indent, DescColumnOffset, help_formatter_component::colour_line_formatter<Indent{}>, PreambleFormatter, AddendumFormatter> |
Same format as the default_help_formatter_t output, but the argument labels are red and the descriptions green.
Indent | Number of spaces per 'level' of indentation, defaults to 4 |
DescColumnOffset | Minimum number of description columns remaining in a terminal line needed to attempt proper line breaks i.e. if it is less than DescColumnOffset then the output just overflows onto the next line, defaults to 8 |
PreambleFormatter | Controls preamble formatting i.e. the 'intro' part of the output that goes before the argument output |
AddendumFormatter | Controls addendum formatting i.e. the part of the output that goes after the argument output |
Definition at line 140 of file colour_help_formatter.hpp.
using arg_router::policy::has_no_result_value = typedef std::is_base_of<no_result_value<>, T> |
Evaluates to true if T uses no_result_value.
T | Type to test |
Definition at line 25 of file no_result_value.hpp.
using arg_router::policy::is_required = typedef std::is_base_of<required_t<>, T> |
Evaluates to true if T is marked as required.
T | Type to test |
Definition at line 53 of file required.hpp.
|
constexprnoexcept |
|
constexprnoexcept |
Constructs a dependent_t with the given policies.
This is used for similarity with arg_t.
DependsPolicies | Pack of policies that define its behaviour |
policies | Pack of policy instances |
Definition at line 183 of file dependent.hpp.
|
constexprnoexcept |
Constructs a min_max_value_ct with the given params.
Max | Maximum value |
Definition at line 268 of file min_max_value.hpp.
|
constexprnoexcept |
Constructs a min_max_value_t with the given params.
ValueType | Maximum value type |
LessThanCompare | Less than comparator type |
max | Maximum value |
compare | Comparator instance |
Definition at line 231 of file min_max_value.hpp.
|
constexprnoexcept |
Constructs a min_max_value_ct with the given params.
Min | Minimum value |
Max | Maximum value |
Definition at line 246 of file min_max_value.hpp.
|
constexprnoexcept |
Constructs a min_max_value_t with the given params.
ValueType | Minimum and maximum value type |
LessThanCompare | Less than comparator type |
min | Minimum value |
max | Maximum value |
compare | Comparator instance |
Definition at line 196 of file min_max_value.hpp.
|
constexprnoexcept |
Constructs a min_max_value_ct with the given params.
Min | Minimum value |
Definition at line 257 of file min_max_value.hpp.
|
constexprnoexcept |
Constructs a min_max_value_t with the given params.
ValueType | Minimum value type |
LessThanCompare | Less than comparator type |
min | Minimum value |
compare | Comparator instance |
Definition at line 214 of file min_max_value.hpp.
|
constexpr |
Constant variable helper.
Definition at line 148 of file colour_help_formatter.hpp.
|
constexpr |
Constant variable helper.
Definition at line 372 of file default_help_formatter.hpp.
|
constexpr |
Constant variable helper.
S | Compile-time string |
Definition at line 50 of file description.hpp.
|
constexpr |
Constant variable helper.
S | Compile-time string |
Definition at line 56 of file display_name.hpp.
|
constexpr |
Constant variable helper.
S | Compile-time string |
Definition at line 54 of file error_name.hpp.
|
constexpr |
Constant variable helper.
TranslationType | multi_lang::translation type for the current language |
FallbackTranslationType | multi_lang::translation type to use as a fall back language if a matching error_code is not found in TranslationType. Set to void if no fallback is required |
Definition at line 87 of file exception_translator.hpp.
|
constexpr |
Constant variable helper for a count of fixed size.
Value | Minimum and maximum count value |
Definition at line 150 of file min_max_count.hpp.
|
constexpr |
Constant variable helper.
Definition at line 21 of file flatten_help.hpp.
|
constexpr |
Helper variable for has_multi_stage_value.
T | Type to test |
Definition at line 80 of file multi_stage_value.hpp.
|
constexpr |
Helper variable for has_no_result_value.
T | Type to test |
Definition at line 32 of file no_result_value.hpp.
|
constexpr |
Helper alias variable for is_all_policies.
Tuple | Tuple of types to test |
Definition at line 53 of file policy.hpp.
|
constexpr |
Helper alias variable for is_policy.
T | Type to test |
Definition at line 38 of file policy.hpp.
|
constexpr |
Helper variable for is_required.
T | Type to test |
Definition at line 60 of file required.hpp.
|
constexpr |
Constant variable helper.
S | compile_time_string |
Definition at line 53 of file long_name.hpp.
|
constexpr |
Constant variable helper for a maximum count with a minimum count of zero.
Value | Maximum count value |
Definition at line 142 of file min_max_count.hpp.
|
constexpr |
Constant variable helper for a minimum count with an unbounded maximum count.
Value | Minimum count value |
Definition at line 133 of file min_max_count.hpp.
|
constexpr |
Constant variable helper.
MinValue | Minimum count value |
MaxValue | Maximum count value |
Definition at line 125 of file min_max_count.hpp.
|
constexpr |
Constant variable helper.
S | Compile-time string |
Definition at line 56 of file none_name.hpp.
|
constexpr |
Constant variable helper.
S | Compile-time string |
Definition at line 53 of file program_addendum.hpp.
|
constexpr |
Constant variable helper.
S | Compile-time string |
Definition at line 53 of file program_intro.hpp.
|
constexpr |
Constant variable helper.
S | Compile-time string |
Definition at line 56 of file program_name.hpp.
|
constexpr |
Constant variable helper.
S | Compile-time string |
Definition at line 53 of file program_version.hpp.
|
constexpr |
Constant variable helper.
Definition at line 46 of file required.hpp.
|
constexpr |
Constant variable helper.
Definition at line 119 of file short_form_expander.hpp.
|
constexpr |
Constant variable helper.
S | Short name character |
Definition at line 59 of file short_name.hpp.
|
constexpr |
Constant variable helper that supports UTF-8 code points.
S | Compile-time string |
Definition at line 66 of file short_name.hpp.
|
constexpr |
Constant variable helper.
S | compile_time_string |
Definition at line 108 of file token_end_marker.hpp.
|
constexpr |
Constant variable helper.
S | Arg/value separator character |
Definition at line 134 of file value_separator.hpp.
|
constexpr |
Constant variable helper that supports UTF-8 code points.
S | UTF-8 code point |
Definition at line 141 of file value_separator.hpp.