Euphoria
|
eu::core::argparse::Parser Struct Reference
root parser. start argumentparsing with this one More...
#include <argparse.h>
Inheritance diagram for eu::core::argparse::Parser:
Public Member Functions | |
Parser (const std::string &d="") | |
ParseResult | parse (const NameAndArguments &args) |
std::optional< int > | parse (int argc, char *argv[]) |
value = return from main nullopt = continue, parsing was ok More... | |
ParserBase * | get_parent_or_null () override |
std::string | get_calling_name (const NameAndArguments &args) override |
Public Member Functions inherited from eu::core::argparse::ParserBase | |
ParserBase (const std::string &d) | |
virtual | ~ParserBase ()=default |
ParserBase (const ParserBase &)=delete | |
ParserBase (ParserBase &&)=delete | |
void | operator= (const ParserBase &)=delete |
void | operator= (ParserBase &&)=delete |
std::string | generate_usage_string (const NameAndArguments &args) |
void | print_help (std::shared_ptr< Printer > printer, const NameAndArguments &args) |
void | on_complete (CompleteFunction com) |
Argument & | add_argument (const Name &name, std::shared_ptr< Argument > argument) |
Argument & | add_void_function (const Name &name, std::function< void()> void_function) |
Argument & | set_true (const Name &name, bool *target) |
Argument & | set_false (const Name &name, bool *target) |
std::shared_ptr< SubParserGroup > | add_sub_parsers (const std::string &name="commands") |
ParseResult | parse_args (Runner *runner) |
template<typename T > | |
Argument & | set_const (const Name &name, T *target, T t) |
template<typename T > | |
Argument & | add (const Name &name, T *target, ParseFunction< T > parse_function=default_parse_function< T >) |
template<typename T > | |
Argument & | add_vector (const Name &name, std::vector< T > *target, ParseFunction< T > parse_function=default_parse_function< T >) |
add greedy argument, currently also accepts zero More... | |
std::shared_ptr< Argument > | find_argument (const std::string &name) const |
Public Attributes | |
std::shared_ptr< argparse::Printer > | printer |
Public Attributes inherited from eu::core::argparse::ParserBase | |
std::string | description |
std::vector< ArgumentAndName > | positional_argument_list |
std::map< std::string, std::shared_ptr< Argument > > | optional_arguments |
std::vector< ArgumentAndName > | optional_argument_list |
EnumToStringImplementation< std::shared_ptr< SubParserContainer > > | subparsers |
std::vector< std::shared_ptr< SubParserGroup > > | subparser_groups |
std::optional< CompleteFunction > | on_complete_function |
State | parser_state = State::adding |
SubParserStyle | parser_style = SubParserStyle::inherit |
Detailed Description
root parser. start argumentparsing with this one
Definition at line 574 of file argparse.h.
Constructor & Destructor Documentation
◆ Parser()
|
explicit |
Definition at line 1288 of file argparse.cc.
Member Function Documentation
◆ get_calling_name()
|
overridevirtual |
Implements eu::core::argparse::ParserBase.
Definition at line 1328 of file argparse.cc.
◆ get_parent_or_null()
|
overridevirtual |
Implements eu::core::argparse::ParserBase.
Definition at line 1296 of file argparse.cc.
◆ parse() [1/2]
ParseResult eu::core::argparse::Parser::parse | ( | const NameAndArguments & | args | ) |
Definition at line 1303 of file argparse.cc.
◆ parse() [2/2]
std::optional< int > eu::core::argparse::Parser::parse | ( | int | argc, |
char * | argv[] | ||
) |
value = return from main nullopt = continue, parsing was ok
Definition at line 1312 of file argparse.cc.
Member Data Documentation
◆ printer
std::shared_ptr<argparse::Printer> eu::core::argparse::Parser::printer |
Definition at line 576 of file argparse.h.
The documentation for this struct was generated from the following files:
- libs/core/src/core/argparse.h
- libs/core/src/core/argparse.cc