make methods of CommandLineArguments const

This commit is contained in:
lganzzzo 2019-03-28 02:41:01 +02:00
parent 6131dcc5f5
commit 5e59def128
2 changed files with 9 additions and 5 deletions

6
.gitignore vendored
View File

@ -31,6 +31,10 @@
*.out
*.app
# Mac
**/.DS_Store
#idea
.idea/
cmake-build-debug/
@ -38,4 +42,4 @@ cmake-build-debug/
#local build
build/
srt/build/
test/build/
test/build/

View File

@ -113,7 +113,7 @@ public:
* @param argName - name of the target argument.
* @return - `true` if present.
*/
bool hasArgument(const char* argName) {
bool hasArgument(const char* argName) const {
return Parser::hasArgument(m_argc, m_argv, argName);
}
@ -122,7 +122,7 @@ public:
* @param argName - name of the target argument.
* @return - index of the argument in argv[] array. -1 if there is no such argument.
*/
v_int32 getArgumentIndex(const char* argName) {
v_int32 getArgumentIndex(const char* argName) const {
return Parser::getArgumentIndex(m_argc, m_argv, argName);
}
@ -135,7 +135,7 @@ public:
* @param defaultValue - default value to return in case not found.
* @return - argument which starts with the specified prefix. defaultValue if not found.
*/
const char* getArgumentStartingWith(const char* argNamePrefix, const char* defaultValue = nullptr) {
const char* getArgumentStartingWith(const char* argNamePrefix, const char* defaultValue = nullptr) const {
return Parser::getArgumentStartingWith(m_argc, m_argv, argNamePrefix, defaultValue);
}
@ -148,7 +148,7 @@ public:
* @param defaultValue - default value to return in case not found.
* @return - value preceded by the argument. defaultValue if not found.
*/
const char* getNamedArgumentValue(const char* argName, const char* defaultValue = nullptr) {
const char* getNamedArgumentValue(const char* argName, const char* defaultValue = nullptr) const {
return Parser::getNamedArgumentValue(m_argc, m_argv, argName, defaultValue);
}