UI::Util::CLOptionOptArg Class Reference

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

`#include <GetOpt.hpp>`

Inheritance diagram for UI::Util::CLOptionOptArg:
Collaboration diagram for UI::Util::CLOptionOptArg:

## Public Member Functions

| CLOptionOptArg (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 option * | getCOptLong (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 optional argument.

## Constructor & Destructor Documentation

## CLOptionOptArg()

UI::Util::CLOptionOptArg::CLOptionOptArg | ( | 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::CLOptionOptArg::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::CLOptionOptArg::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::CLOptionOptArg::printUsage | ( |  | ) | const

virtual

Print usage information for this option.

Reimplemented from UI::Util::CLOption.

References UI::Util::CLOption::defaultArg_, UI::Util::CLOption::getDoc(), UI::Util::CLOption::getNameLong(), and UI::Util::CLOption::getNameShort().

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

- GetOpt.hpp
- GetOpt.cpp