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:
eu::core::argparse::ParserBase

Public Member Functions

 SubParser (const std::string &d, ParserBase *p, argparse::Runner *r, const std::string &cn)
 
ParseResult on_complete (CompleteFunction com)
 
ParserBaseget_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)
 
Argumentadd_argument (const Name &name, std::shared_ptr< Argument > argument)
 
Argumentadd_void_function (const Name &name, std::function< void()> void_function)
 
Argumentset_true (const Name &name, bool *target)
 
Argumentset_false (const Name &name, bool *target)
 
std::shared_ptr< SubParserGroupadd_sub_parsers (const std::string &name="commands")
 
ParseResult parse_args (Runner *runner)
 
template<typename T >
Argumentset_const (const Name &name, T *target, T t)
 
template<typename T >
Argumentadd (const Name &name, T *target, ParseFunction< T > parse_function=default_parse_function< T >)
 
template<typename T >
Argumentadd_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< Argumentfind_argument (const std::string &name) const
 

Public Attributes

ParserBaseparent
 
argparse::Runnerrunner
 
std::string calling_name
 
- Public Attributes inherited from eu::core::argparse::ParserBase
std::string description
 
std::vector< ArgumentAndNamepositional_argument_list
 
std::map< std::string, std::shared_ptr< Argument > > optional_arguments
 
std::vector< ArgumentAndNameoptional_argument_list
 
EnumToStringImplementation< std::shared_ptr< SubParserContainer > > subparsers
 
std::vector< std::shared_ptr< SubParserGroup > > subparser_groups
 
std::optional< CompleteFunctionon_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()

std::string eu::core::argparse::SubParser::get_calling_name ( const NameAndArguments args)
overridevirtual

Implements eu::core::argparse::ParserBase.

Definition at line 1274 of file argparse.cc.

◆ get_parent_or_null()

ParserBase * eu::core::argparse::SubParser::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: