#include <arg_router/root.hpp>
Inherits detail::add_missing_exception_translator::type.
|
using | validator_type = std::tuple_element_t< validator_index, policies_type > |
|
|
template<auto has_exception_translator = detail::add_missing_exception_translator<Params...>::has_exception_translator> |
constexpr | root_t (Params... params, std::enable_if_t< has_exception_translator > *=nullptr) noexcept |
|
void | parse (vector< parsing::token_type > args) const |
|
template<typename Iter , typename = std::enable_if_t<!std::is_same_v<std::decay_t<Iter>, int>>> |
void | parse (Iter begin, Iter end) const |
|
template<typename Container , typename = std::enable_if_t< !std::is_same_v<std::decay_t<Container>, vector<parsing::token_type>>>> |
void | parse (const Container &c) const |
|
void | parse (int argc, char **argv) const |
|
void | help ([[maybe_unused]] std::ostream &stream) const |
|
string | help () const |
|
template<typename... Params>
class arg_router::root_t< Params >
The root of the parse tree.
- Template Parameters
-
Params | The top-level policies and child node types |
Definition at line 54 of file root.hpp.
◆ validator_type
template<typename... Params>
Validator type.
Definition at line 103 of file root.hpp.
◆ root_t()
template<typename... Params>
template<auto has_exception_translator = detail::add_missing_exception_translator<Params...>::has_exception_translator>
constexpr arg_router::root_t< Params >::root_t |
( |
Params... |
params, |
|
|
std::enable_if_t< has_exception_translator > * |
= nullptr |
|
) |
| |
|
inlineexplicitconstexprnoexcept |
Constructor.
- Parameters
-
params | Policy and child instances |
Definition at line 122 of file root.hpp.
◆ help() [1/2]
template<typename... Params>
Overload that writes into a string and returns it.
- Returns
- String holding the help output
Definition at line 278 of file root.hpp.
◆ help() [2/2]
template<typename... Params>
Generates a root-level help string and writes it into stream.
Does nothing if a help node is not present.
- Parameters
-
stream | Output stream to write into |
Definition at line 239 of file root.hpp.
◆ parse() [1/4]
template<typename... Params>
template<typename Container , typename = std::enable_if_t< !std::is_same_v<std::decay_t<Container>, vector<parsing::token_type>>>>
Parse all std::string_view
convertible elements in c.
The first element is not expected to be the executable name.
- Note
- This does not take part in overload resolution if c is a
vector<parsing::token_type>
- Template Parameters
-
- Parameters
-
Definition at line 213 of file root.hpp.
◆ parse() [2/4]
template<typename... Params>
Parse the raw command line arguments.
The first element is expected to be the executable name.
- Parameters
-
argc | Number of arguments |
argv | Array of char pointers to the command line tokens |
- Exceptions
-
Definition at line 228 of file root.hpp.
◆ parse() [3/4]
template<typename... Params>
template<typename Iter , typename = std::enable_if_t<!std::is_same_v<std::decay_t<Iter>, int>>>
Parse the std::string_view
convertible elements between begin and end.
The first element is not expected to be the executable name.
- Note
- The strings must out live the parse process as they are not copied.
- Template Parameters
-
Iter | Iterator type to std::string_view convertible elements |
- Parameters
-
begin | Iterator to the first element |
end | Iterator to the one-past-the-end element |
Definition at line 191 of file root.hpp.
◆ parse() [4/4]
template<typename... Params>
Parse the unprocessed token_types.
The first element is not expected to be the executable name.
- Parameters
-
- Exceptions
-
Definition at line 147 of file root.hpp.
The documentation for this class was generated from the following file: