mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-15 12:51:00 +02:00
Introduce (and use) an IsArgSet accessor method
This commit is contained in:
parent
2b5f085ad1
commit
0cf86a6678
12 changed files with 44 additions and 31 deletions
|
|
@ -379,6 +379,11 @@ void ParseParameters(int argc, const char* const argv[])
|
|||
}
|
||||
}
|
||||
|
||||
bool IsArgSet(const std::string& strArg)
|
||||
{
|
||||
return mapArgs.count(strArg);
|
||||
}
|
||||
|
||||
std::string GetArg(const std::string& strArg, const std::string& strDefault)
|
||||
{
|
||||
if (mapArgs.count(strArg))
|
||||
|
|
@ -498,7 +503,7 @@ const boost::filesystem::path &GetDataDir(bool fNetSpecific)
|
|||
if (!path.empty())
|
||||
return path;
|
||||
|
||||
if (mapArgs.count("-datadir")) {
|
||||
if (IsArgSet("-datadir")) {
|
||||
path = fs::system_complete(mapArgs["-datadir"]);
|
||||
if (!fs::is_directory(path)) {
|
||||
path = "";
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue