mirror of
https://github.com/jwinterm/myriadcoin.git
synced 2026-11-22 10:53:55 +01:00
Merge branch '0.4.x' into 0.5.0.x
Conflicts: src/util.cpp
This commit is contained in:
+19
-2
@@ -449,7 +449,7 @@ inline int64 GetArg(const std::string& strArg, int64 nDefault)
|
||||
return nDefault;
|
||||
}
|
||||
|
||||
inline bool GetBoolArg(const std::string& strArg)
|
||||
inline bool GetBoolArg(const std::string& strArg, bool fDefault=false)
|
||||
{
|
||||
if (mapArgs.count(strArg))
|
||||
{
|
||||
@@ -457,9 +457,26 @@ inline bool GetBoolArg(const std::string& strArg)
|
||||
return true;
|
||||
return (atoi(mapArgs[strArg]) != 0);
|
||||
}
|
||||
return false;
|
||||
return fDefault;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set an argument if it doesn't already have a value
|
||||
*
|
||||
* @param strArg Argument to set (e.g. "-foo")
|
||||
* @param strValue Value (e.g. "1")
|
||||
* @return true if argument gets set, false if it already had a value
|
||||
*/
|
||||
bool SoftSetArg(const std::string& strArg, const std::string& strValue);
|
||||
|
||||
/**
|
||||
* Set a boolean argument if it doesn't already have a value
|
||||
*
|
||||
* @param strArg Argument to set (e.g. "-foo")
|
||||
* @param fValue Value (e.g. false)
|
||||
* @return true if argument gets set, false if it already had a value
|
||||
*/
|
||||
bool SoftSetArg(const std::string& strArg, bool fValue);
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user