Open Lighting Architecture: ola::BaseFlag Class Reference

| Open Lighting Architecture 0.10.9

Loading...
Searching...
No Matches
Public Member Functions | Protected Member Functions | List of all members
ola::BaseFlag Class Reference
Command Line Flags

## Detailed Description

The common implementation.

Inheritance diagram for ola::BaseFlag:

## Public Member Functions
| BaseFlag (const char *arg_type, const char *short_opt, const char *help)
| Create a new BaseFlag.
char | short_opt () const
| Get the flag short option.
const char * | arg_type () const
| Get the flag argument type.
std::string | help () const
| Get the flag help string.
bool | present () const
| Check if the flag was present on the command line. Good for switching behaviour when a flag is used.
void | MarkAsPresent ()
| Set that the flag was present on the command line.
Public Member Functions inherited from ola::FlagInterface
virtual const char * | name () const =0
| Get the flag name.
virtual bool | has_arg () const =0
| Whether the flag requires an argument.
virtual bool | SetValue (const std::string &input)=0
| Set the flag value.

## Protected Member Functions
void | ReplaceUnderscoreWithHyphen (char *input)
const char * | NewCanonicalName (const char *name)

## Constructor & Destructor Documentation

## ◆ BaseFlag()

ola::BaseFlag::BaseFlag | ( | const char * | arg_type,
|  | const char * | short_opt,
|  | const char * | help )
| inline

Create a new BaseFlag.

Parameters

  arg_type | the type of flag argument
  short_opt | the short option for the flag
  help | the help string for the flag

## Member Function Documentation

## ◆ arg_type()

const char * ola::BaseFlag::arg_type | ( |  | ) | const
| inlinevirtual

Get the flag argument type.

Implements ola::FlagInterface.

Reimplemented in ola::Flag< std::string >.

## ◆ help()

std::string ola::BaseFlag::help | ( |  | ) | const
| inlinevirtual

Get the flag help string.

Implements ola::FlagInterface.

## ◆ present()

bool ola::BaseFlag::present | ( |  | ) | const
| inlinevirtual

Check if the flag was present on the command line. Good for switching behaviour when a flag is used.

Returns
  true if the flag was present, false otherwise

Implements ola::FlagInterface.

## ◆ short_opt()

char ola::BaseFlag::short_opt | ( |  | ) | const
| inlinevirtual

Get the flag short option.

Implements ola::FlagInterface.

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

- include/ola/base/FlagsPrivate.h