Bitcoin Core 32.1.0
P2P Digital Currency
Loading...
Searching...
No Matches
TestArgsManager Struct Reference
Inheritance diagram for TestArgsManager:
[legend]
Collaboration diagram for TestArgsManager:
[legend]

Public Member Functions

void ReadConfigString (const std::string &str_config)
void SetupArgs (const std::vector< std::pair< std::string, unsigned int > > &args)
bool ReadConfigStream (std::istream &stream, const std::string &filepath, std::string &error, bool ignore_invalid_keys=false) EXCLUSIVE_LOCKS_REQUIRED(!cs_args)
Public Member Functions inherited from ArgsManager
common::SettingsValue GetSetting (const std::string &arg) const EXCLUSIVE_LOCKS_REQUIRED(!cs_args)
 Get setting value.
std::vector< common::SettingsValue > GetSettingsList (const std::string &arg) const EXCLUSIVE_LOCKS_REQUIRED(!cs_args)
 Get list of setting values.
 ArgsManager ()
 ~ArgsManager ()
void SelectConfigNetwork (const std::string &network) EXCLUSIVE_LOCKS_REQUIRED(!cs_args)
 Select the network in use.
bool ParseParameters (int argc, const char *const argv[], std::string &error) EXCLUSIVE_LOCKS_REQUIRED(!cs_args)
fs::path GetConfigFilePath () const EXCLUSIVE_LOCKS_REQUIRED(!cs_args)
 Return config file path (read-only).
void SetConfigFilePath (fs::path) EXCLUSIVE_LOCKS_REQUIRED(!cs_args)
bool ReadConfigFiles (std::string &error, bool ignore_invalid_keys=false) EXCLUSIVE_LOCKS_REQUIRED(!cs_args)
std::set< std::string > GetUnsuitableSectionOnlyArgs () const EXCLUSIVE_LOCKS_REQUIRED(!cs_args)
 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.
std::list< SectionInfo > GetUnrecognizedSections () const EXCLUSIVE_LOCKS_REQUIRED(!cs_args)
 Log warnings for unrecognized section names in the config file.
std::optional< const Command > GetCommand () const EXCLUSIVE_LOCKS_REQUIRED(!cs_args)
 Get the command and command args (returns std::nullopt if no command provided).
bool CheckCommandOptions (const std::string &command, std::vector< std::string > *errors=nullptr) const EXCLUSIVE_LOCKS_REQUIRED(!cs_args)
 Check that any command-specific options the user specified are valid for the given command.
fs::path GetBlocksDirPath () const EXCLUSIVE_LOCKS_REQUIRED(!cs_args)
 Get blocks directory path.
fs::path GetDataDirBase () const EXCLUSIVE_LOCKS_REQUIRED(!cs_args)
 Get data directory path.
fs::path GetDataDirNet () const EXCLUSIVE_LOCKS_REQUIRED(!cs_args)
 Get data directory path with appended network identifier.
void ClearPathCache () EXCLUSIVE_LOCKS_REQUIRED(!cs_args)
 Clear cached directory paths.
std::vector< std::string > GetArgs (const std::string &strArg) const EXCLUSIVE_LOCKS_REQUIRED(!cs_args)
 Return a vector of strings of the given argument.
bool IsArgSet (const std::string &strArg) const EXCLUSIVE_LOCKS_REQUIRED(!cs_args)
 Return true if the given argument has been manually set.
bool IsArgNegated (const std::string &strArg) const EXCLUSIVE_LOCKS_REQUIRED(!cs_args)
 Return true if the argument was originally passed as a negated option, i.e.
std::string GetArg (const std::string &strArg, const std::string &strDefault) const EXCLUSIVE_LOCKS_REQUIRED(!cs_args)
 Return string argument or default value.
std::optional< std::string > GetArg (const std::string &strArg) const EXCLUSIVE_LOCKS_REQUIRED(!cs_args)
fs::path GetPathArg (std::string arg, const fs::path &default_value={}) const EXCLUSIVE_LOCKS_REQUIRED(!cs_args)
 Return path argument or default value.
template<std::integral Int>
Int GetArg (const std::string &strArg, Int nDefault) const EXCLUSIVE_LOCKS_REQUIRED(!cs_args)
 Return integer argument or default value.
template<std::integral Int>
std::optional< Int > GetArg (const std::string &strArg) const EXCLUSIVE_LOCKS_REQUIRED(!cs_args)
int64_t GetIntArg (const std::string &strArg, int64_t nDefault) const EXCLUSIVE_LOCKS_REQUIRED(!cs_args)
std::optional< int64_t > GetIntArg (const std::string &strArg) const EXCLUSIVE_LOCKS_REQUIRED(!cs_args)
bool GetBoolArg (const std::string &strArg, bool fDefault) const EXCLUSIVE_LOCKS_REQUIRED(!cs_args)
 Return boolean argument or default value.
std::optional< bool > GetBoolArg (const std::string &strArg) const EXCLUSIVE_LOCKS_REQUIRED(!cs_args)
bool SoftSetArg (const std::string &strArg, const std::string &strValue) EXCLUSIVE_LOCKS_REQUIRED(!cs_args)
 Set an argument if it doesn't already have a value.
bool SoftSetBoolArg (const std::string &strArg, bool fValue) EXCLUSIVE_LOCKS_REQUIRED(!cs_args)
 Set a boolean argument if it doesn't already have a value.
void ForceSetArg (const std::string &strArg, const std::string &strValue) EXCLUSIVE_LOCKS_REQUIRED(!cs_args)
ChainType GetChainType () const EXCLUSIVE_LOCKS_REQUIRED(!cs_args)
 Returns the appropriate chain type from the program arguments.
std::string GetChainTypeString () const EXCLUSIVE_LOCKS_REQUIRED(!cs_args)
 Returns the appropriate chain type string from the program arguments.
void AddArg (const std::string &name, const std::string &help, unsigned int flags, const OptionsCategory &cat) EXCLUSIVE_LOCKS_REQUIRED(!cs_args)
 Add argument.
void AddCommand (const std::string &cmd, const std::string &help, std::set< std::string > options={}) EXCLUSIVE_LOCKS_REQUIRED(!cs_args)
 Add command.
void AddHiddenArgs (const std::vector< std::string > &args) EXCLUSIVE_LOCKS_REQUIRED(!cs_args)
 Add many hidden arguments.
void ClearArgs () EXCLUSIVE_LOCKS_REQUIRED(!cs_args)
 Clear available arguments.
void CheckMultipleCLIArgs () const EXCLUSIVE_LOCKS_REQUIRED(!cs_args)
 Check CLI command args.
std::string GetHelpMessage () const EXCLUSIVE_LOCKS_REQUIRED(!cs_args)
 Get the help string.
std::optional< unsigned int > GetArgFlags (const std::string &name) const EXCLUSIVE_LOCKS_REQUIRED(!cs_args)
 Return Flags for known arg.
void SetDefaultFlags (std::optional< unsigned int >) EXCLUSIVE_LOCKS_REQUIRED(!cs_args)
 Set default flags to return for an unknown arg.
bool GetSettingsPath (fs::path *filepath=nullptr, bool temp=false, bool backup=false) const EXCLUSIVE_LOCKS_REQUIRED(!cs_args)
 Get settings file path, or return false if read-write settings were disabled with -nosettings.
bool ReadSettingsFile (std::vector< std::string > *errors=nullptr) EXCLUSIVE_LOCKS_REQUIRED(!cs_args)
 Read settings file.
bool WriteSettingsFile (std::vector< std::string > *errors=nullptr, bool backup=false) const EXCLUSIVE_LOCKS_REQUIRED(!cs_args)
 Write settings file or backup settings file.
common::SettingsValue GetPersistentSetting (const std::string &name) const EXCLUSIVE_LOCKS_REQUIRED(!cs_args)
 Get current setting from config file or read/write settings file, ignoring nonpersistent command line or forced settings values.
template<typename Fn>
void LockSettings (Fn &&fn) EXCLUSIVE_LOCKS_REQUIRED(!cs_args)
 Access settings with lock held.
void LogArgs () const EXCLUSIVE_LOCKS_REQUIRED(!cs_args)
 Log the config file options and the command line arguments, useful for troubleshooting.

Additional Inherited Members

Public Types inherited from ArgsManager
enum  Flags : uint32_t {
  ALLOW_ANY = 0x01 , DISALLOW_NEGATION = 0x20 , DISALLOW_ELISION = 0x40 , DEBUG_ONLY = 0x100 ,
  NETWORK_ONLY = 0x200 , SENSITIVE = 0x400 , COMMAND = 0x800
}
 Flags controlling how config and command line arguments are validated and interpreted. More...
Protected Member Functions inherited from ArgsManager
bool ReadConfigStream (std::istream &stream, const std::string &filepath, std::string &error, bool ignore_invalid_keys=false) EXCLUSIVE_LOCKS_REQUIRED(!cs_args)
bool ReadConfigString (const std::string &str_config) EXCLUSIVE_LOCKS_REQUIRED(!cs_args)

Detailed Description

Definition at line 52 of file argsman_tests.cpp.

Member Function Documentation

◆ ReadConfigStream()

bool ArgsManager::ReadConfigStream ( std::istream & stream,
const std::string & filepath,
std::string & error,
bool ignore_invalid_keys = false )
nodiscard

Definition at line 165 of file config.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ReadConfigString()

void TestArgsManager::ReadConfigString ( const std::string & str_config)
inline

Definition at line 54 of file argsman_tests.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ SetupArgs()

void TestArgsManager::SetupArgs ( const std::vector< std::pair< std::string, unsigned int > > & args)
inline

Definition at line 58 of file argsman_tests.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

The documentation for this struct was generated from the following file: