Changeset View
Changeset View
Standalone View
Standalone View
src/util.h
Show First 20 Lines • Show All 94 Lines • ▼ Show 20 Lines | |||||
class ArgsManager { | class ArgsManager { | ||||
protected: | protected: | ||||
friend class ArgsManagerHelper; | friend class ArgsManagerHelper; | ||||
mutable CCriticalSection cs_args; | mutable CCriticalSection cs_args; | ||||
std::map<std::string, std::vector<std::string>> m_override_args; | std::map<std::string, std::vector<std::string>> m_override_args; | ||||
std::map<std::string, std::vector<std::string>> m_config_args; | std::map<std::string, std::vector<std::string>> m_config_args; | ||||
std::unordered_set<std::string> m_negated_args; | |||||
void ReadConfigStream(std::istream &stream); | void ReadConfigStream(std::istream &stream); | ||||
public: | public: | ||||
void ParseParameters(int argc, const char *const argv[]); | void ParseParameters(int argc, const char *const argv[]); | ||||
void ReadConfigFile(const std::string &confPath); | void ReadConfigFile(const std::string &confPath); | ||||
/** | /** | ||||
▲ Show 20 Lines • Show All 79 Lines • ▼ Show 20 Lines | public: | ||||
* name. | * name. | ||||
* @return CBaseChainParams::MAIN by default; raises runtime error if an | * @return CBaseChainParams::MAIN by default; raises runtime error if an | ||||
* invalid combination is given. | * invalid combination is given. | ||||
*/ | */ | ||||
std::string GetChainName() const; | std::string GetChainName() const; | ||||
// Remove an arg setting, used only in testing | // Remove an arg setting, used only in testing | ||||
void ClearArg(const std::string &strArg); | void ClearArg(const std::string &strArg); | ||||
private: | |||||
// Munge -nofoo into -foo=0 and track the value as negated. | |||||
void InterpretNegatedOption(std::string &key, std::string &val); | |||||
}; | }; | ||||
extern ArgsManager gArgs; | extern ArgsManager gArgs; | ||||
/** | /** | ||||
* @return true if help has been requested via a command-line arg | * @return true if help has been requested via a command-line arg | ||||
*/ | */ | ||||
bool HelpRequested(const ArgsManager &args); | bool HelpRequested(const ArgsManager &args); | ||||
▲ Show 20 Lines • Show All 59 Lines • Show Last 20 Lines |