dlugolecki.net.pl
Dziennik
Polecane
Software
projects
/
command.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix memory leaks, fix tests.
[command.git]
/
include
/
parameter.h
diff --git
a/include/parameter.h
b/include/parameter.h
index e55a2d1e248c2fe3541fb3395177a52691c33dee..1396f830d07ed3d63f11eb9540f6bc028a71c4cd 100644
(file)
--- a/
include/parameter.h
+++ b/
include/parameter.h
@@
-8,15
+8,12
@@
namespace command {
/**
namespace command {
/**
- * Class responsible for handling commandline arguments.
- * Arguments are required,x non-named parameters of program.
+ * Base class for all the Arguments and Options.
*
* Example:
* ./myprog ARGUMENT
*/
class Parameter : public Descriptive {
*
* Example:
* ./myprog ARGUMENT
*/
class Parameter : public Descriptive {
- protected:
- std:string userValue;
public:
typedef class Parameter Type;
/**
public:
typedef class Parameter Type;
/**
@@
-24,16
+21,22
@@
namespace command {
*
* @param description Description of current Argument
*/
*
* @param description Description of current Argument
*/
- Parameter(
std::string
description)
+ Parameter(
const std::string &
description)
: Descriptive(description) {
}
: Descriptive(description) {
}
- virtual ~Parameter() {}
+ virtual ~Parameter() { }
+
+ /**
+ * Method used for handling method calls linked with Argument or Option
+ */
virtual void handle() = 0;
virtual void handle() = 0;
- virtual void passUserValue(std::string argVal) {
- userValue = argVal;
- }
+ /**
+ * Method used for checking if the given user value understandable for
+ * parameter.
+ */
+ virtual bool understand(const std::string & ) = 0;
};
}
};
}