dlugolecki.net.pl
Dziennik
Polecane
Software
projects
/
command.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
d6d77f0
)
Make code safer.
author
Rafał Długołęcki
<rafal@dlugolecki.net.pl>
Sat, 2 May 2015 16:42:05 +0000
(18:42 +0200)
committer
Rafał Długołęcki
<rafal@dlugolecki.net.pl>
Sat, 2 May 2015 16:42:05 +0000
(18:42 +0200)
include/argument.h
patch
|
blob
|
history
include/option.h
patch
|
blob
|
history
include/parameter.h
patch
|
blob
|
history
tests/callable/invokes_provided_function.cpp
patch
|
blob
|
history
tests/parameter/TestParameter.h
patch
|
blob
|
history
diff --git
a/include/argument.h
b/include/argument.h
index eee218fb7d4720b65193ec45979249abd688c78f..3ac1d71a8c034172263bff28f3235a36280720a0 100644
(file)
--- a/
include/argument.h
+++ b/
include/argument.h
@@
-25,7
+25,7
@@
namespace command {
* @param description Description of current Argument
* @param function Function used to handle current Argument.
*/
* @param description Description of current Argument
* @param function Function used to handle current Argument.
*/
- Argument(
std::string
description, void (*function)(ArgumentType))
+ Argument(
const std::string &
description, void (*function)(ArgumentType))
: Parameter(description), Callable<ArgumentType>(function) {
}
virtual ~Argument() { }
: Parameter(description), Callable<ArgumentType>(function) {
}
virtual ~Argument() { }
diff --git
a/include/option.h
b/include/option.h
index be65e772d06a6f42a868558d7d91002855e94d74..270bb76410f3c8bfead32c44adf0a6928cea707c 100644
(file)
--- a/
include/option.h
+++ b/
include/option.h
@@
-30,7
+30,7
@@
namespace command {
* @param description Description of current Option
* @param function Function used to handle current Option.
*/
* @param description Description of current Option
* @param function Function used to handle current Option.
*/
- Option(std::string name,
std::string
description, void (*function)(OptionType))
+ Option(std::string name,
const std::string &
description, void (*function)(OptionType))
: Parameter(description), Callable<OptionType>(function), name(name) {
}
virtual ~Option() { }
: Parameter(description), Callable<OptionType>(function), name(name) {
}
virtual ~Option() { }
diff --git
a/include/parameter.h
b/include/parameter.h
index ed792184d1047a264921bb5ce94d1af87b58e490..a96128c407e50f226d417a8ac5b811cf3944eb7a 100644
(file)
--- a/
include/parameter.h
+++ b/
include/parameter.h
@@
-21,7
+21,7
@@
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) {
}
virtual ~Parameter() {}
: Descriptive(description) {
}
virtual ~Parameter() {}
diff --git
a/tests/callable/invokes_provided_function.cpp
b/tests/callable/invokes_provided_function.cpp
index 7322da546907379b60858267d6164225c6db2fef..5defb08cb1d2a790bd38274ac1cf0e89099452ae 100644
(file)
--- a/
tests/callable/invokes_provided_function.cpp
+++ b/
tests/callable/invokes_provided_function.cpp
@@
-14,7
+14,6
@@
void function(bool val) {
};
int main() {
};
int main() {
-
TestCallable<bool> callable(function);
callable.callFunction(true);
TestCallable<bool> callable(function);
callable.callFunction(true);
diff --git
a/tests/parameter/TestParameter.h
b/tests/parameter/TestParameter.h
index 9736133cddaf4ec3a1c8358f1635f220c2d626db..592c6532911dd85dc43b2c0ba710c75ba89eb901 100644
(file)
--- a/
tests/parameter/TestParameter.h
+++ b/
tests/parameter/TestParameter.h
@@
-3,7
+3,7
@@
class TestParameter : public command::Parameter {
public:
class TestParameter : public command::Parameter {
public:
- TestParameter(
std::string
description) : Parameter(description) { }
+ TestParameter(
const std::string &
description) : Parameter(description) { }
virtual void handle() { }
virtual bool understand(const std::string & argVal) { }
virtual void handle() { }
virtual bool understand(const std::string & argVal) { }