From: Rafał Długołęcki Date: Wed, 6 May 2015 16:33:43 +0000 (+0200) Subject: Documentation improvements. X-Git-Tag: v0.2~10 X-Git-Url: https://git.dlugolecki.net.pl/?a=commitdiff_plain;h=e7c2ad96ad56116b2bfca1000f425287b1a02da2;p=command.git Documentation improvements. --- diff --git a/include/argument.h b/include/argument.h index dfaea65..5690e5d 100644 --- a/include/argument.h +++ b/include/argument.h @@ -14,9 +14,9 @@ namespace command { * Arguments are non-named parameters of program. * * Example: - * ./myprog ARGUMENT - * ./myprog /path/to/file - * ./myprog "some argument" + * - ./myprog ARGUMENT + * - ./myprog /path/to/file + * - ./myprog "some argument" */ template class Argument : public Parameter, public Callable { @@ -41,7 +41,7 @@ namespace command { virtual ~Argument() { } /** - * + * \inheritdoc */ virtual void handle() { this->call(value); diff --git a/include/option.h b/include/option.h index 963d662..516fce0 100644 --- a/include/option.h +++ b/include/option.h @@ -13,9 +13,9 @@ namespace command { * Options are named parameters of program. * * Example: - * ./myprog OptionName=OptionValue - * ./myprog -f=/some/file - * ./myprog --level=15 + * - ./myprog OptionName=OptionValue + * - ./myprog -f=/some/file + * - ./myprog --level=15 */ template class Option @@ -51,7 +51,7 @@ namespace command { virtual ~Option() { } /** - * + * \inheritdoc */ virtual void handle() { this->call(value); diff --git a/include/parameter.h b/include/parameter.h index a54a967..443111d 100644 --- a/include/parameter.h +++ b/include/parameter.h @@ -32,23 +32,34 @@ namespace command { virtual ~Parameter() { } /** - * Method used for handling method calls linked with Argument or Option + * Method used for handling method calls linked with this Parameter */ virtual void handle() = 0; /** * Method used for checking if the given user value understandable for * parameter. + * + * @return true if passed value is understandable by current Parameter. + * False otherwise. */ virtual bool understand(const std::string & ) = 0; /** * Indicates if current Parameter is required + * + * @return false, as all Parameters are non-required by default. If you + * want to make Parameter as required, wrap it using Required class */ virtual bool isRequired() { return false; }; + /** + * Indicates if current Parameter has been already used + * + * @return true if current Parameter has been already used. False otherwise. + */ virtual bool isUsed() { return used; } diff --git a/include/required.h b/include/required.h index bdb6299..a4e0622 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,13 +53,19 @@ 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();