* 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<typename ParameterType>
class Argument : public Parameter, public Callable<ParameterType> {
virtual ~Argument() { }
/**
- *
+ * \inheritdoc
*/
virtual void handle() {
this->call(value);
* 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<typename ParameterType>
class Option
virtual ~Option() { }
/**
- *
+ * \inheritdoc
*/
virtual void handle() {
this->call(value);
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;
}
}
/**
- * 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);
/**
* 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();