- ParseParameters
- ReadConfigFile
- ForceSetArg
- SoftSetArg
Includes:
- Introduce an ArgsManager class encapsulating cs_args, mapArgs and mapMultiArgs #9494
From the wrappers newly introduced with ArgsManager, these seem currently the easiest to remove.
Includes:
From the wrappers newly introduced with ArgsManager, these seem currently the easiest to remove.
378+ mapMultiArgs[str].push_back(strValue);
379 }
380 }
381
382-bool IsArgSet(const std::string& strArg)
383+std::vector<std::string> ArgsManager::ArgsAt(const std::string& strArg)
Any reason to not return a const ref?
Also, ArgsAt is a bit of an odd name, perhaps ArgsFor or something (but maybe not worth the effort to redo this)
442-void ForceSetArg(const std::string& strArg, const std::string& strValue)
443+void ArgsManager::ForceSetArg(const std::string& strArg, const std::string& strValue)
444 {
445 LOCK(cs_args);
446 mapArgs[strArg] = strValue;
447+ mapMultiArgs[strArg].push_back(strValue);
445 LOCK(cs_args);
446 mapArgs[strArg] = strValue;
447+ mapMultiArgs[strArg].push_back(strValue);
448 }
449
450+bool IsArgSet(const std::string& strArg)
130@@ -133,6 +131,16 @@ inline bool IsSwitchChar(char c)
131 #endif
132 }
133
134+class ArgsManager
135+{
136+protected:
137+ CCriticalSection cs_args;
138+ std::map<std::string, std::string> mapArgs;
139+ std::map<std::string, std::vector<std::string> > mapMultiArgs;
- ParseParameters
- ReadConfigFile
- ForceSetArg
- SoftSetArg
Labels
Refactoring