#include <system.h>
|
| ArgsManager () |
|
void | SelectConfigNetwork (const std::string &network) |
|
NODISCARD bool | ParseParameters (int argc, const char *const argv[], std::string &error) |
|
NODISCARD bool | ReadConfigFiles (std::string &error, bool ignore_invalid_keys=false) |
|
const std::set< std::string > | GetUnsuitableSectionOnlyArgs () const |
|
const std::list< SectionInfo > | GetUnrecognizedSections () const |
|
std::vector< std::string > | GetArgs (const std::string &strArg) const |
|
bool | IsArgSet (const std::string &strArg) const |
|
bool | IsArgNegated (const std::string &strArg) const |
|
std::string | GetArg (const std::string &strArg, const std::string &strDefault) const |
|
int64_t | GetArg (const std::string &strArg, int64_t nDefault) const |
|
bool | GetBoolArg (const std::string &strArg, bool fDefault) const |
|
bool | SoftSetArg (const std::string &strArg, const std::string &strValue) |
|
bool | SoftSetBoolArg (const std::string &strArg, bool fValue) |
|
void | ForceSetArg (const std::string &strArg, const std::string &strValue) |
|
std::string | GetChainName () const |
|
void | AddArg (const std::string &name, const std::string &help, const bool debug_only, const OptionsCategory &cat) |
|
void | AddHiddenArgs (const std::vector< std::string > &args) |
|
void | ClearArgs () |
|
std::string | GetHelpMessage () const |
|
bool | IsArgKnown (const std::string &key) const |
|
◆ ArgsManager()
ArgsManager::ArgsManager |
( |
| ) |
|
◆ AddArg()
void ArgsManager::AddArg |
( |
const std::string & |
name, |
|
|
const std::string & |
help, |
|
|
const bool |
debug_only, |
|
|
const OptionsCategory & |
cat |
|
) |
| |
◆ AddHiddenArgs()
void ArgsManager::AddHiddenArgs |
( |
const std::vector< std::string > & |
args | ) |
|
Add many hidden arguments
◆ ClearArgs()
void ArgsManager::ClearArgs |
( |
| ) |
|
|
inline |
Clear available arguments
◆ ForceSetArg()
void ArgsManager::ForceSetArg |
( |
const std::string & |
strArg, |
|
|
const std::string & |
strValue |
|
) |
| |
◆ GetArg() [1/2]
std::string ArgsManager::GetArg |
( |
const std::string & |
strArg, |
|
|
const std::string & |
strDefault |
|
) |
| const |
Return string argument or default value
- Parameters
-
strArg | Argument to get (e.g. "-foo") |
strDefault | (e.g. "1") |
- Returns
- command-line argument or default value
◆ GetArg() [2/2]
int64_t ArgsManager::GetArg |
( |
const std::string & |
strArg, |
|
|
int64_t |
nDefault |
|
) |
| const |
Return integer argument or default value
- Parameters
-
strArg | Argument to get (e.g. "-foo") |
nDefault | (e.g. 1) |
- Returns
- command-line argument (0 if invalid number) or default value
◆ GetArgs()
std::vector< std::string > ArgsManager::GetArgs |
( |
const std::string & |
strArg | ) |
const |
Return a vector of strings of the given argument
- Parameters
-
strArg | Argument to get (e.g. "-foo") |
- Returns
- command-line arguments
◆ GetBoolArg()
bool ArgsManager::GetBoolArg |
( |
const std::string & |
strArg, |
|
|
bool |
fDefault |
|
) |
| const |
Return boolean argument or default value
- Parameters
-
strArg | Argument to get (e.g. "-foo") |
fDefault | (true or false) |
- Returns
- command-line argument or default value
◆ GetChainName()
std::string ArgsManager::GetChainName |
( |
| ) |
const |
Looks for -regtest, -testnet and returns the appropriate BIP70 chain name.
- Returns
- CBaseChainParams::MAIN by default; raises runtime error if an invalid combination is given.
◆ GetHelpMessage()
std::string ArgsManager::GetHelpMessage |
( |
| ) |
const |
◆ GetUnrecognizedSections()
const std::list< SectionInfo > ArgsManager::GetUnrecognizedSections |
( |
| ) |
const |
Log warnings for unrecognized section names in the config file.
◆ GetUnsuitableSectionOnlyArgs()
const std::set< std::string > ArgsManager::GetUnsuitableSectionOnlyArgs |
( |
| ) |
const |
Log warnings for options in m_section_only_args when they are specified in the default section but not overridden on the command line or in a network-specific section in the config file.
◆ GUARDED_BY() [1/6]
std::map<std::string, std::vector<std::string> > m_override_args ArgsManager::GUARDED_BY |
( |
cs_args |
| ) |
|
|
protected |
◆ GUARDED_BY() [2/6]
std::map<std::string, std::vector<std::string> > m_config_args ArgsManager::GUARDED_BY |
( |
cs_args |
| ) |
|
|
protected |
◆ GUARDED_BY() [3/6]
std::string m_network ArgsManager::GUARDED_BY |
( |
cs_args |
| ) |
|
|
protected |
◆ GUARDED_BY() [4/6]
std::set<std::string> m_network_only_args ArgsManager::GUARDED_BY |
( |
cs_args |
| ) |
|
|
protected |
◆ GUARDED_BY() [5/6]
◆ GUARDED_BY() [6/6]
◆ IsArgKnown()
bool ArgsManager::IsArgKnown |
( |
const std::string & |
key | ) |
const |
Check whether we know of this arg
◆ IsArgNegated()
bool ArgsManager::IsArgNegated |
( |
const std::string & |
strArg | ) |
const |
Return true if the argument was originally passed as a negated option, i.e. -nofoo.
- Parameters
-
strArg | Argument to get (e.g. "-foo") |
- Returns
- true if the argument was passed negated
◆ IsArgSet()
bool ArgsManager::IsArgSet |
( |
const std::string & |
strArg | ) |
const |
Return true if the given argument has been manually set
- Parameters
-
strArg | Argument to get (e.g. "-foo") |
- Returns
- true if the argument has been set
◆ ParseParameters()
bool ArgsManager::ParseParameters |
( |
int |
argc, |
|
|
const char *const |
argv[], |
|
|
std::string & |
error |
|
) |
| |
◆ ReadConfigFiles()
bool ArgsManager::ReadConfigFiles |
( |
std::string & |
error, |
|
|
bool |
ignore_invalid_keys = false |
|
) |
| |
◆ ReadConfigStream()
bool ArgsManager::ReadConfigStream |
( |
std::istream & |
stream, |
|
|
const std::string & |
filepath, |
|
|
std::string & |
error, |
|
|
bool |
ignore_invalid_keys = false |
|
) |
| |
|
protected |
◆ SelectConfigNetwork()
void ArgsManager::SelectConfigNetwork |
( |
const std::string & |
network | ) |
|
Select the network in use
◆ SoftSetArg()
bool ArgsManager::SoftSetArg |
( |
const std::string & |
strArg, |
|
|
const std::string & |
strValue |
|
) |
| |
Set an argument if it doesn't already have a value
- Parameters
-
strArg | Argument to set (e.g. "-foo") |
strValue | Value (e.g. "1") |
- Returns
- true if argument gets set, false if it already had a value
◆ SoftSetBoolArg()
bool ArgsManager::SoftSetBoolArg |
( |
const std::string & |
strArg, |
|
|
bool |
fValue |
|
) |
| |
Set a boolean argument if it doesn't already have a value
- Parameters
-
strArg | Argument to set (e.g. "-foo") |
fValue | Value (e.g. false) |
- Returns
- true if argument gets set, false if it already had a value
◆ ArgsManagerHelper
◆ cs_args
The documentation for this class was generated from the following files: