Command  0.3
Public Types | Public Member Functions | Protected Attributes | List of all members
command::Parameter Class Referenceabstract

#include <parameter.h>

Inheritance diagram for command::Parameter:
[legend]
Collaboration diagram for command::Parameter:
[legend]

Public Types

typedef class Parameter Type
 

Public Member Functions

 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
 
- Public Member Functions inherited from command::Descriptive
 Descriptive (const std::string &description)
 
const std::string & describe ()
 

Protected Attributes

bool used = false
 

Detailed Description

Base class for all the Arguments and Options.

Example: ./myprog ARGUMENT

Constructor & Destructor Documentation

◆ Parameter()

command::Parameter::Parameter ( const std::string &  description)
inline

Default constructor.

Parameters
descriptionDescription of current Argument

Member Function Documentation

◆ handle()

virtual void command::Parameter::handle ( )
pure virtual

◆ hungryForValue()

virtual bool command::Parameter::hungryForValue ( )
inlinevirtual

Reimplemented in command::Grouped.

◆ isRequired()

virtual bool command::Parameter::isRequired ( )
inlinevirtual

Indicates if current Parameter is required

Returns
false, as all Parameters are non-required by default. If you want to make Parameter as required, wrap it using Required class

Reimplemented in command::MultiValue, and command::Required.

◆ isUsed()

virtual bool command::Parameter::isUsed ( )
inlinevirtual

Indicates if current Parameter has been already used

Returns
true if current Parameter has been already used. False otherwise.

Reimplemented in command::MultiValue, and command::Required.

◆ understand()

virtual bool command::Parameter::understand ( const std::string &  )
pure virtual

Method used for checking if the given user value understandable for parameter.

Returns
true if passed value is understandable by current Parameter. False otherwise.

Implemented in command::Argument< ParameterType >, command::Option< ParameterType >, command::Option< void >, command::Grouped, command::MultiValue, and command::Required.

◆ valuePosition()

virtual unsigned int command::Parameter::valuePosition ( const std::string &  )
pure virtual

Member Data Documentation

◆ used

bool command::Parameter::used = false
protected

Variable indicating if current Parameter was already used or not


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