Open Lighting Architecture  Latest Git
Public Member Functions | Protected Member Functions | List of all members
ola::BaseFlag Class Reference

Detailed Description

The common implementation.

Inheritance diagram for ola::BaseFlag:
Inheritance graph
[legend]
Collaboration diagram for ola::BaseFlag:
Collaboration graph
[legend]

Public Member Functions

 BaseFlag (const char *arg_type, const char *short_opt, const char *help)
 Create a new BaseFlag. More...
 
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. More...
 
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. More...
 

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_typethe type of flag argument
short_optthe short option for the flag
helpthe help string for the flag

Member Function Documentation

◆ 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.


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