Euphoria
eu::core::argparse::SingleArgument Struct Reference

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

#include <argparse.h>

Inheritance diagram for eu::core::argparse::SingleArgument:
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

 SingleArgument (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 274 of file argparse.h.

Member Typedef Documentation

◆ CallbackFunction

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

Definition at line 276 of file argparse.h.

◆ DescribeFunction

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

Definition at line 286 of file argparse.h.

Constructor & Destructor Documentation

◆ SingleArgument()

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

Definition at line 413 of file argparse.cc.

Member Function Documentation

◆ get_second_line()

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

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

Definition at line 428 of file argparse.cc.

◆ have_nargs()

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

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

Definition at line 421 of file argparse.cc.

◆ parse_arguments()

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

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

Definition at line 435 of file argparse.cc.

Member Data Documentation

◆ callback_function

CallbackFunction eu::core::argparse::SingleArgument::callback_function

Definition at line 288 of file argparse.h.

◆ describe_function

DescribeFunction eu::core::argparse::SingleArgument::describe_function

Definition at line 289 of file argparse.h.


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