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 formatting.
[command.git]
/
include
/
parameter.h
diff --git
a/include/parameter.h
b/include/parameter.h
index a54a967e36e87bd0c9394d31b5a4b24dde22c541..87c1590ccc85fbcdbe9d6f69ce01f0d5fd2253a6 100644
(file)
--- a/
include/parameter.h
+++ b/
include/parameter.h
@@
-2,6
+2,7
@@
#define __COMMAND_PARAMETER_H
#include <string>
#define __COMMAND_PARAMETER_H
#include <string>
+#include <sstream>
#include "descriptive.h"
#include "callable.h"
#include "descriptive.h"
#include "callable.h"
@@
-32,26
+33,48
@@
namespace command {
virtual ~Parameter() { }
/**
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.
*/
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
*/
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;
};
*/
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;
}
virtual bool isUsed() {
return used;
}
+
+ /**
+ */
+ virtual bool hungryForValue() {
+ return false;
+ }
+
+ /**
+ * @return position where value starts in passed string
+ */
+ virtual unsigned int valuePosition(const std::string & ) = 0;
};
}
};
}