Fabcoin Core  0.16.2
P2P Digital Currency
Public Member Functions | Protected Attributes | List of all members
ArgsManager Class Reference

#include <util.h>

Collaboration diagram for ArgsManager:
[legend]

Public Member Functions

void ParseParameters (int argc, const char *const argv[])
 
void ReadConfigFile (const std::string &confPath)
 
std::vector< std::string > GetArgs (const std::string &strArg)
 
bool IsArgSet (const std::string &strArg)
 Return true if the given argument has been manually set. More...
 
std::string GetArg (const std::string &strArg, const std::string &strDefault)
 Return string argument or default value. More...
 
int64_t GetArg (const std::string &strArg, int64_t nDefault)
 Return integer argument or default value. More...
 
bool GetBoolArg (const std::string &strArg, bool fDefault)
 Return boolean argument or default value. More...
 
bool SoftSetArg (const std::string &strArg, const std::string &strValue)
 Set an argument if it doesn't already have a value. More...
 
bool SoftSetBoolArg (const std::string &strArg, bool fValue)
 Set a boolean argument if it doesn't already have a value. More...
 
void ForceSetArg (const std::string &strArg, const std::string &strValue)
 

Protected Attributes

CCriticalSection cs_args
 
std::map< std::string, std::string > mapArgs
 
std::map< std::string, std::vector< std::string > > mapMultiArgs
 

Detailed Description

Definition at line 215 of file util.h.

Member Function Documentation

void ArgsManager::ForceSetArg ( const std::string &  strArg,
const std::string &  strValue 
)

Definition at line 545 of file util.cpp.

Here is the caller graph for this function:

std::string ArgsManager::GetArg ( const std::string &  strArg,
const std::string &  strDefault 
)

Return string argument or default value.

Parameters
strArgArgument to get (e.g. "-foo")
strDefault(e.g. "1")
Returns
command-line argument or default value

Definition at line 504 of file util.cpp.

int64_t ArgsManager::GetArg ( const std::string &  strArg,
int64_t  nDefault 
)

Return integer argument or default value.

Parameters
strArgArgument to get (e.g. "-foo")
nDefault(e.g. 1)
Returns
command-line argument (0 if invalid number) or default value

Definition at line 512 of file util.cpp.

Here is the call graph for this function:

std::vector< std::string > ArgsManager::GetArgs ( const std::string &  strArg)

Definition at line 490 of file util.cpp.

Here is the caller graph for this function:

bool ArgsManager::GetBoolArg ( const std::string &  strArg,
bool  fDefault 
)

Return boolean argument or default value.

Parameters
strArgArgument to get (e.g. "-foo")
fDefault(true or false)
Returns
command-line argument or default value

Definition at line 520 of file util.cpp.

Here is the caller graph for this function:

bool ArgsManager::IsArgSet ( const std::string &  strArg)

Return true if the given argument has been manually set.

Parameters
strArgArgument to get (e.g. "-foo")
Returns
true if the argument has been set

Definition at line 498 of file util.cpp.

Here is the caller graph for this function:

void ArgsManager::ParseParameters ( int  argc,
const char *const  argv[] 
)

Definition at line 454 of file util.cpp.

Here is the caller graph for this function:

void ArgsManager::ReadConfigFile ( const std::string &  confPath)

Definition at line 669 of file util.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

bool ArgsManager::SoftSetArg ( const std::string &  strArg,
const std::string &  strValue 
)

Set an argument if it doesn't already have a value.

Parameters
strArgArgument to set (e.g. "-foo")
strValueValue (e.g. "1")
Returns
true if argument gets set, false if it already had a value

Definition at line 528 of file util.cpp.

Here is the caller graph for this function:

bool ArgsManager::SoftSetBoolArg ( const std::string &  strArg,
bool  fValue 
)

Set a boolean argument if it doesn't already have a value.

Parameters
strArgArgument to set (e.g. "-foo")
fValueValue (e.g. false)
Returns
true if argument gets set, false if it already had a value

Definition at line 537 of file util.cpp.

Here is the caller graph for this function:

Member Data Documentation

CCriticalSection ArgsManager::cs_args
protected

Definition at line 218 of file util.h.

std::map<std::string, std::string> ArgsManager::mapArgs
protected

Definition at line 219 of file util.h.

std::map<std::string, std::vector<std::string> > ArgsManager::mapMultiArgs
protected

Definition at line 220 of file util.h.


The documentation for this class was generated from the following files: