1 #ifndef __COMMAND_REQUIRED_H
2 #define __COMMAND_REQUIRED_H
8 * Required Parameter decorator. Makes passed Parameters treated as required
10 class Required : public Parameter {
13 * Parameter which will be treated as required
15 Parameter * parameter;
19 * Default constructor.
21 * @param parameter Parameter which will be treated as required
23 Required(Parameter * parameter)
24 : Parameter(parameter->describe()), parameter(parameter) {
28 * Default destructor. Releases allocated memory
35 * Wrapper method around passed Parameter::handle().
39 virtual void handle() {
44 * Wrapper method around passed Parameter::understand()
46 * @param argv command line value against which test will be made
50 virtual bool understand(const std::string & value) {
51 return parameter->understand(value);
55 * Indicates if current Parameter is required
57 * @return true, as all Parameters wrapped in Required class are set as
58 * required. In order to make them non-required do not use
61 virtual bool isRequired() {
66 * Wrapper method around passed Parameter::isUsed().
70 virtual bool isUsed() {
71 return parameter->isUsed();
75 * Wrapper method around passed Parameter::valuePosition().
79 virtual unsigned int valuePosition(const std::string & value) {
80 return parameter->valuePosition(value);
85 #endif /* __COMMAND_REQUIRED_H */