ui-utilcpp 1.10.3
Public Member Functions
UI::Util::CLOptionArg Class Reference

Class representing a command line option with mandatory argument. More...

#include <GetOpt.hpp>

Inheritance diagram for UI::Util::CLOptionArg:
Inheritance graph
Collaboration diagram for UI::Util::CLOptionArg:
Collaboration graph

Public Member Functions

 CLOptionArg (std::string const &nameLong, char nameShort, std::string const &doc="No documentation for this option.", std::string const &defaultArg="")
 Standard constructor.
 
virtual void printUsage () const
 Print usage information for this option.
 
virtual optiongetCOptLong (option *opt) const
 Get GNU getopt_long(3) represention of this option.
 
virtual std::string getCOptShort () const
 Get GNU getopt(3) represention of this option.
 
- Public Member Functions inherited from UI::Util::CLOption
 CLOption (std::string const &nameLong, char nameShort, std::string const &doc="No documentation for this option.", std::string const &defaultArg="")
 Standard constructor. Normally, you would not use this directly, but rather use GetOpt::set.
 
std::string getNameLong () const
 Get the long name.
 
char getNameShort () const
 Get the short name.
 
std::string getDoc () const
 Get the documentation.
 
bool isGiven () const
 Check if this option was given.
 
std::string getArg () const
 Get argument given with this option.
 
virtual void setGiven (std::string const &arg="")
 Mark this option as "given", and optionally set the argument.
 

Additional Inherited Members

- Protected Attributes inherited from UI::Util::CLOption
std::string const defaultArg_
 

Detailed Description

Class representing a command line option with mandatory argument.

Constructor & Destructor Documentation

◆ CLOptionArg()

UI::Util::CLOptionArg::CLOptionArg ( std::string const nameLong,
char  nameShort,
std::string const doc = "No documentation for this option.",
std::string const defaultArg = "" 
)

Standard constructor.

See also
CLOption::CLOption.

Member Function Documentation

◆ getCOptLong()

option * UI::Util::CLOptionArg::getCOptLong ( option opt) const
virtual

Get GNU getopt_long(3) represention of this option.

Returns
Corresponding option struct for GNU getopt_long(3).

Reimplemented from UI::Util::CLOption.

References UI::Util::CLOption::getCOptLong().

◆ getCOptShort()

std::string UI::Util::CLOptionArg::getCOptShort ( ) const
virtual

Get GNU getopt(3) represention of this option.

Returns
Corresponding "optstr" for getopt(3).

Reimplemented from UI::Util::CLOption.

References UI::Util::CLOption::getNameShort().

◆ printUsage()

void UI::Util::CLOptionArg::printUsage ( ) const
virtual

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