Open Lighting Architecture 0.10.9
Loading...
Searching...
No Matches
ola::FlagInterface Class Referenceabstract

Detailed Description

The interface for the Flag classes.

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

Public Member Functions

virtual const char * name () const =0
 Get the flag name.
 
virtual char short_opt () const =0
 Get the flag short option.
 
virtual bool has_arg () const =0
 Whether the flag requires an argument.
 
virtual const char * arg_type () const =0
 Get the flag argument type.
 
virtual std::string help () const =0
 Get the flag help string.
 
virtual bool present () const =0
 Check if the flag was present on the command line. Good for switching behaviour when a flag is used.
 
virtual bool SetValue (const std::string &input)=0
 Set the flag value.
 

Member Function Documentation

◆ arg_type()

virtual const char * ola::FlagInterface::arg_type ( ) const
pure virtual

Get the flag argument type.

Implemented in ola::BaseFlag, and ola::Flag< std::string >.

◆ has_arg()

virtual bool ola::FlagInterface::has_arg ( ) const
pure virtual

Whether the flag requires an argument.

Implemented in ola::Flag< T >, ola::Flag< bool >, and ola::Flag< std::string >.

◆ help()

virtual std::string ola::FlagInterface::help ( ) const
pure virtual

Get the flag help string.

Implemented in ola::BaseFlag.

◆ name()

virtual const char * ola::FlagInterface::name ( ) const
pure virtual

Get the flag name.

Implemented in ola::Flag< T >, ola::Flag< bool >, and ola::Flag< std::string >.

◆ present()

virtual bool ola::FlagInterface::present ( ) const
pure virtual

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

Implemented in ola::BaseFlag.

◆ SetValue()

virtual bool ola::FlagInterface::SetValue ( const std::string & input)
pure virtual

Set the flag value.

Parameters
inputthe input passed on the command line
Returns
true on success, false otherwise

Implemented in ola::Flag< T >, ola::Flag< bool >, and ola::Flag< std::string >.

◆ short_opt()

virtual char ola::FlagInterface::short_opt ( ) const
pure virtual

Get the flag short option.

Implemented in ola::BaseFlag.


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