aboutsummaryrefslogtreecommitdiff
path: root/util.h
diff options
context:
space:
mode:
authorgavinandresen <gavinandresen@1a98c847-1fd6-4fd8-948a-caf3550aa51b>2010-12-03 19:38:09 +0000
committergavinandresen <gavinandresen@1a98c847-1fd6-4fd8-948a-caf3550aa51b>2010-12-03 19:38:09 +0000
commitbdde31d787c4fe2da8e9fb168abbd22af2c27442 (patch)
tree46005f6e32c45217699a84a4ed3b8a665359a0bb /util.h
parentbfd471f53e14c4218ae7a1544beb7f1de3e695b2 (diff)
All boolean options/flags now work the same way.
git-svn-id: https://bitcoin.svn.sourceforge.net/svnroot/bitcoin/trunk@194 1a98c847-1fd6-4fd8-948a-caf3550aa51b
Diffstat (limited to 'util.h')
-rw-r--r--util.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/util.h b/util.h
index 31ba4f5224..f57e401067 100644
--- a/util.h
+++ b/util.h
@@ -417,6 +417,17 @@ inline int64 GetArg(const string& strArg, int64 nDefault)
return nDefault;
}
+inline bool GetBoolArg(const string& strArg)
+{
+ if (mapArgs.count(strArg))
+ {
+ if (mapArgs[strArg].empty())
+ return true;
+ return (atoi(mapArgs[strArg]) != 0);
+ }
+ return false;
+}
+
inline string FormatVersion(int nVersion)
{
if (nVersion%100 == 0)