Euphoria
|
eu::core::argparse::SubParser Struct Reference
subparser, don't create manually but add to a existing parser AddSubParsers()->Add(...); More...
#include <argparse.h>
Inheritance diagram for eu::core::argparse::SubParser:
Public Member Functions | |
SubParser (const std::string &d, ParserBase *p, argparse::Runner *r, const std::string &cn) | |
ParseResult | on_complete (CompleteFunction com) |
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 | |
ParserBase * | parent |
argparse::Runner * | runner |
std::string | calling_name |
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
subparser, don't create manually but add to a existing parser AddSubParsers()->Add(...);
Definition at line 553 of file argparse.h.
Constructor & Destructor Documentation
◆ SubParser()
eu::core::argparse::SubParser::SubParser | ( | const std::string & | d, |
ParserBase * | p, | ||
argparse::Runner * | r, | ||
const std::string & | cn | ||
) |
Definition at line 1251 of file argparse.cc.
Member Function Documentation
◆ get_calling_name()
|
overridevirtual |
Implements eu::core::argparse::ParserBase.
Definition at line 1274 of file argparse.cc.
◆ get_parent_or_null()
|
overridevirtual |
Implements eu::core::argparse::ParserBase.
Definition at line 1267 of file argparse.cc.
◆ on_complete()
ParseResult eu::core::argparse::SubParser::on_complete | ( | CompleteFunction | com | ) |
Definition at line 1281 of file argparse.cc.
Member Data Documentation
◆ calling_name
std::string eu::core::argparse::SubParser::calling_name |
Definition at line 557 of file argparse.h.
◆ parent
ParserBase* eu::core::argparse::SubParser::parent |
Definition at line 555 of file argparse.h.
◆ runner
argparse::Runner* eu::core::argparse::SubParser::runner |
Definition at line 556 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