@@ -195,21 +195,28 @@ inline bool IsSwitchChar(char c)
195195class ArgsManager
196196{
197197protected:
198- CCriticalSection cs_args;
198+ mutable CCriticalSection cs_args;
199199 std::map<std::string, std::string> mapArgs;
200- std::map<std::string, std::vector<std::string> > mapMultiArgs;
200+ std::map<std::string, std::vector<std::string>> mapMultiArgs;
201201public:
202202 void ParseParameters (int argc, const char *const argv[]);
203203 void ReadConfigFile (const std::string& confPath);
204- std::vector<std::string> GetArgs (const std::string& strArg);
204+
205+ /* *
206+ * Return a vector of strings of the given argument
207+ *
208+ * @param strArg Argument to get (e.g. "-foo")
209+ * @return command-line arguments
210+ */
211+ std::vector<std::string> GetArgs (const std::string& strArg) const ;
205212
206213 /* *
207214 * Return true if the given argument has been manually set
208215 *
209216 * @param strArg Argument to get (e.g. "-foo")
210217 * @return true if the argument has been set
211218 */
212- bool IsArgSet (const std::string& strArg);
219+ bool IsArgSet (const std::string& strArg) const ;
213220
214221 /* *
215222 * Return string argument or default value
@@ -218,7 +225,7 @@ class ArgsManager
218225 * @param strDefault (e.g. "1")
219226 * @return command-line argument or default value
220227 */
221- std::string GetArg (const std::string& strArg, const std::string& strDefault);
228+ std::string GetArg (const std::string& strArg, const std::string& strDefault) const ;
222229
223230 /* *
224231 * Return integer argument or default value
@@ -227,7 +234,7 @@ class ArgsManager
227234 * @param nDefault (e.g. 1)
228235 * @return command-line argument (0 if invalid number) or default value
229236 */
230- int64_t GetArg (const std::string& strArg, int64_t nDefault);
237+ int64_t GetArg (const std::string& strArg, int64_t nDefault) const ;
231238
232239 /* *
233240 * Return boolean argument or default value
@@ -236,7 +243,7 @@ class ArgsManager
236243 * @param fDefault (true or false)
237244 * @return command-line argument or default value
238245 */
239- bool GetBoolArg (const std::string& strArg, bool fDefault );
246+ bool GetBoolArg (const std::string& strArg, bool fDefault ) const ;
240247
241248 /* *
242249 * Set an argument if it doesn't already have a value
0 commit comments