Euphoria
eu::core::argparse::MultiArgument Struct Reference

a single argument, probably either a –count 3 or positional input More...

#include <argparse.h>

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

Public Types

using CallbackFunction = std::function< ParseResult(Runner *runner, const std::string &name, ParserBase *caller, const std::string &value) >
 
using DescribeFunction = std::function< std::optional< std::string >()>
 

Public Member Functions

 MultiArgument (CallbackFunction cb, DescribeFunction d)
 
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
 
DescribeFunction describe_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 single argument, probably either a –count 3 or positional input

Definition at line 305 of file argparse.h.

Member Typedef Documentation

◆ CallbackFunction

using eu::core::argparse::MultiArgument::CallbackFunction = std::function < ParseResult ( Runner* runner, const std::string& name, ParserBase* caller, const std::string& value ) >

Definition at line 307 of file argparse.h.

◆ DescribeFunction

using eu::core::argparse::MultiArgument::DescribeFunction = std::function<std::optional<std::string> ()>

Definition at line 317 of file argparse.h.

Constructor & Destructor Documentation

◆ MultiArgument()

eu::core::argparse::MultiArgument::MultiArgument ( CallbackFunction  cb,
DescribeFunction  d 
)

Definition at line 365 of file argparse.cc.

Member Function Documentation

◆ get_second_line()

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

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

Definition at line 380 of file argparse.cc.

◆ have_nargs()

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

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

Definition at line 373 of file argparse.cc.

◆ parse_arguments()

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

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

Definition at line 387 of file argparse.cc.

Member Data Documentation

◆ callback_function

CallbackFunction eu::core::argparse::MultiArgument::callback_function

Definition at line 319 of file argparse.h.

◆ describe_function

DescribeFunction eu::core::argparse::MultiArgument::describe_function

Definition at line 320 of file argparse.h.


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