From 5e59def1284fc82575c9a30023d3bcfcf36e09ee Mon Sep 17 00:00:00 2001 From: lganzzzo Date: Thu, 28 Mar 2019 02:41:01 +0200 Subject: [PATCH] make methods of CommandLineArguments const --- .gitignore | 6 +++++- src/oatpp/core/base/CommandLineArguments.hpp | 8 ++++---- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/.gitignore b/.gitignore index c6a30523..4e9336e1 100644 --- a/.gitignore +++ b/.gitignore @@ -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/ \ No newline at end of file +test/build/ diff --git a/src/oatpp/core/base/CommandLineArguments.hpp b/src/oatpp/core/base/CommandLineArguments.hpp index bda1d8be..13294e89 100644 --- a/src/oatpp/core/base/CommandLineArguments.hpp +++ b/src/oatpp/core/base/CommandLineArguments.hpp @@ -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); }