Euphoria
eu::core::argparse::ArgumentNoValue Struct Reference

a argument with no value, probably either a –set-true or a void function like –help More...

#include <argparse.h>

Inheritance diagram for eu::core::argparse::ArgumentNoValue:
eu::core::argparse::Argument

Public Types

using CallbackFunction = std::function< ParseResult(Runner *)>
 

Public Member Functions

 ArgumentNoValue (CallbackFunction cb)
 
bool have_nargs () override
 
std::optional< std::string > get_second_line () override
 
ParseResult parse_arguments (Runner *runner, const std::string &name, ParserBase *caller) override
 
- Public Member Functions inherited from eu::core::argparse::Argument
 Argument ()=default
 
virtual ~Argument ()=default
 
 Argument (const Argument &)=delete
 
 Argument (Argument &&)=delete
 
void operator= (const Argument &)=delete
 
void operator= (Argument &&)=delete
 
Argumentset_nargs (const std::string &na)
 
Argumentset_help (const std::string &h)
 
Argumentset_allow_before_positionals ()
 

Public Attributes

CallbackFunction callback_function
 
- Public Attributes inherited from eu::core::argparse::Argument
std::string help
 
std::string nargs
 
bool allow_before_positionals = false
 
std::string default_value
 

Detailed Description

a argument with no value, probably either a –set-true or a void function like –help

Definition at line 253 of file argparse.h.

Member Typedef Documentation

◆ CallbackFunction

Definition at line 255 of file argparse.h.

Constructor & Destructor Documentation

◆ ArgumentNoValue()

eu::core::argparse::ArgumentNoValue::ArgumentNoValue ( CallbackFunction  cb)
explicit

Definition at line 332 of file argparse.cc.

Member Function Documentation

◆ get_second_line()

std::optional< std::string > eu::core::argparse::ArgumentNoValue::get_second_line ( )
overridevirtual

Implements eu::core::argparse::Argument.

Definition at line 346 of file argparse.cc.

◆ have_nargs()

bool eu::core::argparse::ArgumentNoValue::have_nargs ( )
overridevirtual

Implements eu::core::argparse::Argument.

Definition at line 339 of file argparse.cc.

◆ parse_arguments()

ParseResult eu::core::argparse::ArgumentNoValue::parse_arguments ( Runner runner,
const std::string &  name,
ParserBase caller 
)
overridevirtual

Implements eu::core::argparse::Argument.

Definition at line 354 of file argparse.cc.

Member Data Documentation

◆ callback_function

CallbackFunction eu::core::argparse::ArgumentNoValue::callback_function

Definition at line 257 of file argparse.h.


The documentation for this struct was generated from the following files: