koutil
|
Template class representing a parser. More...
#include <parser.h>
Public Member Functions | |
constexpr | Parser (Ctx &ctx, Args &&args, Cmds &&commands) |
constexpr | Parser (Ctx &ctx, const Args &args, const Cmds &commands) |
ParseResult | parse (std::size_t argc, const char **argv) |
Parses the command-line arguments. | |
Private Member Functions | |
ParseResult | parse_long_opt (std::string_view opt) |
Parses a long option. | |
ParseResult | parse_short_opt (std::string_view opt) |
Parses a short option. | |
ParseResult | parse_command_or_argument (std::string_view opt) |
Parses a command or argument. | |
Private Attributes | |
Args | m_args |
Cmds | m_subcommands |
ArgumentsBase const * | m_current_args = &m_args |
CommandsBase const * | m_current_cms = &m_subcommands |
Ctx & | m_ctx |
std::span< const char * > | m_values |
std::size_t | m_offset = 0 |
Template class representing a parser.
Ctx | The context type. |
UParser | The user-defined parser type. |
Args | The argument types. |
Cmds | The command types. |
|
inlineconstexpr |
|
inlineconstexpr |
ParseResult koutil::argparser::Parser< Ctx, UParser, Args, Cmds >::parse | ( | std::size_t | argc, |
const char ** | argv ) |
Parses the command-line arguments.
argc | The argument count. |
argv | The argument values. |
|
private |
Parses a command or argument.
opt | The command or argument. |
|
private |
Parses a long option.
opt | The long option. |
|
private |
Parses a short option.
opt | The short option. |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |