Command
0.3
|
#include <option.h>
Public Types | |
typedef std::string | OptionName |
![]() | |
typedef class Parameter | Type |
Public Member Functions | |
Option (const std::string &name, const std::string &description, std::function< void(void)> function) | |
virtual void | handle () |
virtual bool | understand (const std::string &argv) |
virtual unsigned int | valuePosition (const std::string &) |
![]() | |
Parameter (const std::string &description) | |
virtual void | handle ()=0 |
virtual bool | understand (const std::string &)=0 |
virtual bool | isRequired () |
virtual bool | isUsed () |
virtual bool | hungryForValue () |
virtual unsigned int | valuePosition (const std::string &)=0 |
![]() | |
Descriptive (const std::string &description) | |
const std::string & | describe () |
![]() | |
Callable (std::function< void(void)> function) | |
Protected Attributes | |
const OptionName | name |
![]() | |
bool | used = false |
![]() | |
std::function< void(void)> | func |
Additional Inherited Members | |
![]() | |
void | call () |
Template class responsible for handling commandline options. Options are non-required, named parameters of program. This template specialization allows Options to work like switches. It means that just named parameter is needed to invoke command. No value is used.
Example: ./myprog OptionName ./myprog -h ./myprog –help
|
inline |
|
inlinevirtual |
Method used for handling method calls linked with this Parameter
Implements command::Parameter.
|
inlinevirtual |
Method used for checking if Option understands given user value. If so, current Option is flagged as used and no more checks against it will be done in future.
Passed value should be in form of: OptionName
argv | command line value against which test will be made. User value should be in format: OptionName. |
Implements command::Parameter.
|
inlinevirtual |
Implements command::Parameter.
|
protected |
Current Option name