Open Lighting Architecture  0.9.2
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Protected Member Functions | List of all members
ola::BaseFlag Class Reference

Detailed Description

The common implementation.

Inheritance diagram for ola::BaseFlag:
ola::FlagInterface ola::Flag< T > ola::Flag< bool > ola::Flag< std::string >

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

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

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: