1 #ifndef __COMMAND_PARAMETER_H
2 #define __COMMAND_PARAMETER_H
7 #include "descriptive.h"
12 * Base class for all the Arguments and Options.
17 class Parameter : public Descriptive {
19 /** Variable indicating if current Parameter was already used or not */
23 typedef class Parameter Type;
25 * Default constructor.
27 * @param description Description of current Argument
29 Parameter(const std::string & description)
30 : Descriptive(description) {
33 virtual ~Parameter() { }
36 * Method used for handling method calls linked with this Parameter
38 virtual void handle() = 0;
41 * Method used for checking if the given user value understandable for
44 * @return true if passed value is understandable by current Parameter.
47 virtual bool understand(const std::string & ) = 0;
50 * Indicates if current Parameter is required
52 * @return false, as all Parameters are non-required by default. If you
53 * want to make Parameter as required, wrap it using Required class
55 virtual bool isRequired() {
60 * Indicates if current Parameter has been already used
62 * @return true if current Parameter has been already used. False otherwise.
64 virtual bool isUsed() {
70 virtual bool hungryForValue() {
75 * @return position where value starts in passed string
77 virtual unsigned int valuePosition(const std::string & ) = 0;
81 #endif /* __COMMAND_PARAMETER_H */