Changeset View
Changeset View
Standalone View
Standalone View
src/util.h
Show First 20 Lines • Show All 114 Lines • ▼ Show 20 Lines | enum class OptionsCategory { | ||||
ZMQ, | ZMQ, | ||||
DEBUG_TEST, | DEBUG_TEST, | ||||
CHAINPARAMS, | CHAINPARAMS, | ||||
NODE_RELAY, | NODE_RELAY, | ||||
BLOCK_CREATION, | BLOCK_CREATION, | ||||
RPC, | RPC, | ||||
GUI, | GUI, | ||||
COMMANDS, | COMMANDS, | ||||
REGISTER_COMMANDS | REGISTER_COMMANDS, | ||||
// Always the last option to avoid printing these in the help | |||||
HIDDEN, | |||||
}; | }; | ||||
class ArgsManager { | class ArgsManager { | ||||
protected: | protected: | ||||
friend class ArgsManagerHelper; | friend class ArgsManagerHelper; | ||||
struct Arg { | |||||
std::string m_help_param; | |||||
std::string m_help_text; | |||||
bool m_debug_only; | |||||
Arg(const std::string &help_param, const std::string &help_text, | |||||
bool debug_only) | |||||
: m_help_param(help_param), m_help_text(help_text), | |||||
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>> 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::string m_network; | std::string m_network; | ||||
std::set<std::string> m_network_only_args; | std::set<std::string> m_network_only_args; | ||||
std::map<std::pair<OptionsCategory, std::string>, | std::map<OptionsCategory, std::map<std::string, Arg>> m_available_args; | ||||
std::pair<std::string, bool>> | |||||
m_available_args; | |||||
void ReadConfigStream(std::istream &stream); | void ReadConfigStream(std::istream &stream); | ||||
public: | public: | ||||
ArgsManager(); | ArgsManager(); | ||||
/** | /** | ||||
* Select the network in use | * Select the network in use | ||||
▲ Show 20 Lines • Show All 188 Lines • Show Last 20 Lines |