ed792184d1047a264921bb5ce94d1af87b58e490
[command.git] / include / parameter.h
1 #ifndef __COMMAND_PARAMETER_H
2 #define __COMMAND_PARAMETER_H
3
4 #include <string>
5
6 #include "descriptive.h"
7 #include "callable.h"
8
9 namespace command {
10     /**
11      * Base class for all the Arguments and Options.
12      *
13      * Example:
14      *  ./myprog ARGUMENT
15      */
16     class Parameter : public Descriptive {
17     public:
18         typedef class Parameter Type;
19         /**
20          * Default constructor.
21          *
22          * @param description Description of current Argument
23          */
24         Parameter(std::string description)
25             : Descriptive(description) {
26         }
27         virtual ~Parameter() {}
28
29         /**
30          * Method used for handling method calls linked with Argument or Option
31          */
32         virtual void handle() = 0;
33
34         /**
35          * Method used for checking if the given user value understandable for
36          * parameter.
37          */
38         virtual bool understand(const std::string & ) = 0;
39     };
40 }
41
42 #endif /* __COMMAND_PARAMETER_H */