Small documentation improvements. Added possibility to pass user values for Parameters.
[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      * Class responsible for handling commandline arguments.
12      * Arguments are required,x non-named parameters of program.
13      *
14      * Example:
15      *  ./myprog ARGUMENT
16      */
17     class Parameter : public Descriptive {
18     protected:
19         std:string userValue;
20     public:
21         typedef class Parameter Type;
22         /**
23          * Default constructor.
24          *
25          * @param description Description of current Argument
26          */
27         Parameter(std::string description)
28             : Descriptive(description) {
29         }
30         virtual ~Parameter() {}
31
32         virtual void handle() = 0;
33
34         virtual void passUserValue(std::string argVal) {
35             userValue = argVal;
36         }
37     };
38 }
39
40 #endif /* __COMMAND_PARAMETER_H */