Added command line option --data-dir.

This commit is contained in:
XMRig 2020-03-10 15:57:47 +07:00
parent 64650bf121
commit 8698b73036
No known key found for this signature in database
GPG key ID: 446A53638BE94409
10 changed files with 126 additions and 63 deletions

View file

@ -5,8 +5,8 @@
* Copyright 2014-2016 Wolf9466 <https://github.com/OhGodAPet>
* Copyright 2016 Jay D Dee <jayddee246@gmail.com>
* Copyright 2017-2018 XMR-Stak <https://github.com/fireice-uk>, <https://github.com/psychocrypt>
* Copyright 2018-2019 SChernykh <https://github.com/SChernykh>
* Copyright 2016-2019 XMRig <https://github.com/xmrig>, <support@xmrig.com>
* Copyright 2018-2020 SChernykh <https://github.com/SChernykh>
* Copyright 2016-2020 XMRig <https://github.com/xmrig>, <support@xmrig.com>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -52,6 +52,23 @@ bool xmrig::Arguments::hasArg(const char *name) const
}
const char *xmrig::Arguments::value(const char *key) const
{
const size_t size = m_data.size();
if (size < 3) {
return nullptr;
}
for (size_t i = 1; i < size - 1; ++i) {
if (m_data[i] == key) {
return m_data[i + 1];
}
}
return nullptr;
}
void xmrig::Arguments::add(const char *arg)
{
if (arg == nullptr) {

View file

@ -5,8 +5,8 @@
* Copyright 2014-2016 Wolf9466 <https://github.com/OhGodAPet>
* Copyright 2016 Jay D Dee <jayddee246@gmail.com>
* Copyright 2017-2018 XMR-Stak <https://github.com/fireice-uk>, <https://github.com/psychocrypt>
* Copyright 2018-2019 SChernykh <https://github.com/SChernykh>
* Copyright 2016-2019 XMRig <https://github.com/xmrig>, <support@xmrig.com>
* Copyright 2018-2020 SChernykh <https://github.com/SChernykh>
* Copyright 2016-2020 XMRig <https://github.com/xmrig>, <support@xmrig.com>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -41,6 +41,7 @@ public:
Arguments(int argc, char **argv);
bool hasArg(const char *name) const;
const char *value(const char *key) const;
inline char **argv() const { return m_argv; }
inline const std::vector<String> &data() const { return m_data; }