Command  0.3
Public Member Functions | Protected Attributes | List of all members
command::MultiValue Class Reference

#include <multiValue.h>

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

Public Member Functions

 MultiValue (std::string separator, Parameter *parameter)
 
virtual ~MultiValue ()
 
virtual void handle ()
 
virtual bool understand (const std::string &value)
 
virtual bool isRequired ()
 
virtual bool isUsed ()
 
virtual unsigned int valuePosition (const std::string &value)
 
- Public Member Functions inherited from command::Parameter
 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

Parameterparameter
 
std::vector< std::string > values
 
std::string separator
 
- Protected Attributes inherited from command::Parameter
bool used = false
 

Additional Inherited Members

- Public Types inherited from command::Parameter
typedef class Parameter Type
 

Detailed Description

Multiple Value Parameter decorator. Allows Parameters to understand many values.

Example:

Example usage:

Constructor & Destructor Documentation

◆ MultiValue()

command::MultiValue::MultiValue ( std::string  separator,
Parameter parameter 
)
inline

Default constructor.

Parameters
parameterParameter which will be treated as containing multiple values

◆ ~MultiValue()

virtual command::MultiValue::~MultiValue ( )
inlinevirtual

Default destructor. Releases allocated memory

Member Function Documentation

◆ handle()

virtual void command::MultiValue::handle ( )
inlinevirtual

Wrapper method around passed Parameter::handle().

Method used for handling method calls linked with this Parameter

Implements command::Parameter.

◆ isRequired()

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

Wrapper method around passed Parameter::isRequired(). Indicates if current Parameter is required.

Returns
true if Parameter is required, false otherwise

Reimplemented from command::Parameter.

◆ isUsed()

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

Wrapper method around passed Parameter::isUsed().

Indicates if current Parameter has been already used

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

Reimplemented from command::Parameter.

◆ understand()

virtual bool command::MultiValue::understand ( const std::string &  value)
inlinevirtual

Wrapper method around passed Parameter::understand()

Parameters
argvcommand line value against which test will be made

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

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

Implements command::Parameter.

◆ valuePosition()

virtual unsigned int command::MultiValue::valuePosition ( const std::string &  value)
inlinevirtual

Wrapper method around passed Parameter::valuePosition().

Returns
position where value starts in passed string

Implements command::Parameter.

Member Data Documentation

◆ parameter

Parameter* command::MultiValue::parameter
protected

Parameter which will be treated as containing multiple values


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