X-Git-Url: https://git.dlugolecki.net.pl/?a=blobdiff_plain;f=include%2Frequired.h;h=f88d2ae15051c3a9bf71949ba7ba90b7c661dc9d;hb=2c6d7b737661b171a6ee730b35d90ac14d9021e2;hp=bdb629983c5b7504e160c10b031e4e566be3f893;hpb=0d52a8d02278592356f94ac17b1ccc5fcea388a5;p=command.git diff --git a/include/required.h b/include/required.h index bdb6299..f88d2ae 100644 --- a/include/required.h +++ b/include/required.h @@ -32,17 +32,20 @@ namespace command { } /** - * Method used for handling method calls to linked Parameter + * Wrapper method around passed Parameter::handle(). + * + * \inheritdoc */ virtual void handle() { parameter->handle(); } /** - * Method used for checking if the given user value is understandable by - * parameter. + * Wrapper method around passed Parameter::understand() + * + * @param argv command line value against which test will be made * - * @param value value from argv to check against + * \inheritdoc */ virtual bool understand(const std::string & value) { return parameter->understand(value); @@ -50,18 +53,33 @@ namespace command { /** * Indicates if current Parameter is required + * + * @return true, as all Parameters wrapped in Required class are set as + * required. In order to make them non-required do not use + * Required class */ virtual bool isRequired() { return true; }; /** - * Indicates if current Parameter is already used + * Wrapper method around passed Parameter::isUsed(). + * + * \inheritdoc */ virtual bool isUsed() { return parameter->isUsed(); - }; + } + + /** + * Wrapper method around passed Parameter::valuePosition(). + * + * \inheritdoc + */ + virtual unsigned int valuePosition(const std::string & value) { + return parameter->valuePosition(value); + } }; } -#endif /* __COMMAND_PARAMETER_H */ +#endif /* __COMMAND_REQUIRED_H */