Skip to content

Commit

Permalink
remove unused gArgs wrappers
Browse files Browse the repository at this point in the history
  • Loading branch information
Marko Bencun authored and barrystyle committed Jan 22, 2020
1 parent e6b8c46 commit ade2fe8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 59 deletions.
6 changes: 3 additions & 3 deletions src/util.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -654,8 +654,8 @@ const fs::path &GetDataDir(bool fNetSpecific)
if (!path.empty())
return path;

if (IsArgSet("-datadir")) {
path = fs::system_complete(GetArg("-datadir", ""));
if (gArgs.IsArgSet("-datadir")) {
path = fs::system_complete(gArgs.GetArg("-datadir", ""));
if (!fs::is_directory(path)) {
path = "";
return path;
Expand Down Expand Up @@ -730,7 +730,7 @@ void ArgsManager::ReadConfigFile(const std::string& confPath)
#ifndef WIN32
fs::path GetPidFile()
{
fs::path pathPidFile(GetArg("-pid", BITCOIN_PID_FILENAME));
fs::path pathPidFile(gArgs.GetArg("-pid", BITCOIN_PID_FILENAME));
if (!pathPidFile.is_complete()) pathPidFile = GetDataDir() / pathPidFile;
return pathPidFile;
}
Expand Down
56 changes: 0 additions & 56 deletions src/util.h
Original file line number Diff line number Diff line change
Expand Up @@ -308,62 +308,6 @@ void ForceRemoveArg(const std::string& strArg);

extern ArgsManager gArgs;

// wrappers using the global ArgsManager:
static inline void ParseParameters(int argc, const char*const argv[])
{
gArgs.ParseParameters(argc, argv);
}

static inline void ReadConfigFile(const std::string& confPath)
{
gArgs.ReadConfigFile(confPath);
}

static inline bool SoftSetArg(const std::string& strArg, const std::string& strValue)
{
return gArgs.SoftSetArg(strArg, strValue);
}

static inline void ForceSetArg(const std::string& strArg, const std::string& strValue)
{
gArgs.ForceSetArg(strArg, strValue);
}

static inline bool IsArgSet(const std::string& strArg)
{
return gArgs.IsArgSet(strArg);
}

static inline std::string GetArg(const std::string& strArg, const std::string& strDefault)
{
return gArgs.GetArg(strArg, strDefault);
}

static inline int64_t GetArg(const std::string& strArg, int64_t nDefault)
{
return gArgs.GetArg(strArg, nDefault);
}

static inline bool GetBoolArg(const std::string& strArg, bool fDefault)
{
return gArgs.GetBoolArg(strArg, fDefault);
}

static inline bool SoftSetBoolArg(const std::string& strArg, bool fValue)
{
return gArgs.SoftSetBoolArg(strArg, fValue);
}

static inline void ForceSetMultiArgs(const std::string& strArg, const std::vector<std::string>& values)
{
gArgs.ForceSetMultiArgs(strArg, values);
}

static inline void ForceRemoveArg(const std::string& strArg)
{
gArgs.ForceRemoveArg(strArg);
}

/**
* Format a string to be used as group of options in help messages
*
Expand Down

0 comments on commit ade2fe8

Please sign in to comment.