Changeset View
Changeset View
Standalone View
Standalone View
src/util/system.h
| Show First 20 Lines • Show All 142 Lines • ▼ Show 20 Lines | struct Arg { | ||||
| Arg(const std::string &help_param, const std::string &help_text, | Arg(const std::string &help_param, const std::string &help_text, | ||||
| bool debug_only) | bool debug_only) | ||||
| : m_help_param(help_param), m_help_text(help_text), | : m_help_param(help_param), m_help_text(help_text), | ||||
| m_debug_only(debug_only){}; | m_debug_only(debug_only){}; | ||||
| }; | }; | ||||
| 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>> | ||||
| std::map<std::string, std::vector<std::string>> m_config_args; | m_override_args GUARDED_BY(cs_args); | ||||
| std::string m_network; | std::map<std::string, std::vector<std::string>> | ||||
| std::set<std::string> m_network_only_args; | m_config_args GUARDED_BY(cs_args); | ||||
| std::map<OptionsCategory, std::map<std::string, Arg>> m_available_args; | std::string m_network GUARDED_BY(cs_args); | ||||
| std::set<std::string> m_network_only_args GUARDED_BY(cs_args); | |||||
| std::map<OptionsCategory, std::map<std::string, Arg>> | |||||
| m_available_args GUARDED_BY(cs_args); | |||||
| bool ReadConfigStream(std::istream &stream, std::string &error, | bool ReadConfigStream(std::istream &stream, std::string &error, | ||||
| bool ignore_invalid_keys = false); | bool ignore_invalid_keys = false); | ||||
| public: | public: | ||||
| ArgsManager(); | ArgsManager(); | ||||
| /** | /** | ||||
| ▲ Show 20 Lines • Show All 106 Lines • ▼ Show 20 Lines | void AddArg(const std::string &name, const std::string &help, | ||||
| const bool debug_only, const OptionsCategory &cat); | const bool debug_only, const OptionsCategory &cat); | ||||
| // 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); | ||||
| /** | /** | ||||
| * Clear available arguments | * Clear available arguments | ||||
| */ | */ | ||||
| void ClearArgs() { m_available_args.clear(); } | void ClearArgs() { | ||||
| LOCK(cs_args); | |||||
| m_available_args.clear(); | |||||
| } | |||||
| /** | /** | ||||
| * Get the help string | * Get the help string | ||||
| */ | */ | ||||
| std::string GetHelpMessage() const; | std::string GetHelpMessage() const; | ||||
| /** | /** | ||||
| * Check whether we know of this arg | * Check whether we know of this arg | ||||
| ▲ Show 20 Lines • Show All 100 Lines • Show Last 20 Lines | |||||