diff options
author | psychocrypt <psychocrypt@users.noreply.github.com> | 2017-10-26 20:58:27 +0200 |
---|---|---|
committer | psychocrypt <psychocrypt@users.noreply.github.com> | 2017-10-27 20:13:19 +0200 |
commit | 12802f12e30f57c2a9eefca2c1a5955275c95127 (patch) | |
tree | a10bced239ecd012ceeed593571a3fb8bccee9cb /xmrstak/misc | |
parent | 41451d91e8e50f2b6c4b07630987dbc5a58aecb9 (diff) | |
download | xmr-stak-12802f12e30f57c2a9eefca2c1a5955275c95127.zip xmr-stak-12802f12e30f57c2a9eefca2c1a5955275c95127.tar.gz |
rename `xmr` to `monero`
- rename all `xmr` to `monero`
- be insensitive while check for set currency
- add function to compate two strings insensitive
Diffstat (limited to 'xmrstak/misc')
-rw-r--r-- | xmrstak/misc/executor.cpp | 6 | ||||
-rw-r--r-- | xmrstak/misc/utility.cpp | 21 | ||||
-rw-r--r-- | xmrstak/misc/utility.hpp | 12 |
3 files changed, 36 insertions, 3 deletions
diff --git a/xmrstak/misc/executor.cpp b/xmrstak/misc/executor.cpp index 885961a..b469dc2 100644 --- a/xmrstak/misc/executor.cpp +++ b/xmrstak/misc/executor.cpp @@ -21,7 +21,7 @@ * */ -#include "../jconf.hpp" +#include "xmrstak/jconf.hpp" #include "executor.hpp" #include "xmrstak/net/jpsock.hpp" @@ -184,7 +184,7 @@ void executor::on_sock_ready(size_t pool_id) if(pool_id == dev_pool_id) { - if(::jconf::inst()->IsCurrencyXMR()) + if(::jconf::inst()->IsCurrencyMonero()) { if(!pool->cmd_login("", "")) pool->disconnect(); @@ -362,7 +362,7 @@ void executor::on_switch_pool(size_t pool_id) // as we never receive further events printer::inst()->print_msg(L1, "Connecting to dev pool..."); std::string dev_pool_addr; - if(::jconf::inst()->IsCurrencyXMR()) + if(::jconf::inst()->IsCurrencyMonero()) dev_pool_addr = jconf::inst()->GetTlsSetting() ? "donate.xmr-stak.net:6666" : "donate.xmr-stak.net:3333"; else dev_pool_addr = jconf::inst()->GetTlsSetting() ? "mine.aeon-pool.com:443" : "mine.aeon-pool.com:5555"; diff --git a/xmrstak/misc/utility.cpp b/xmrstak/misc/utility.cpp new file mode 100644 index 0000000..3b1369a --- /dev/null +++ b/xmrstak/misc/utility.cpp @@ -0,0 +1,21 @@ +#include <string> +#include <algorithm> + + +namespace xmrstak +{ + bool strcmp_i(const std::string& str1, const std::string& str2) + { + if(str1.size() != str2.size()) + return false; + else + return (str1.empty() | str2.empty()) ? + false : + std::equal(str1.begin(), str1.end(),str2.begin(), + [](char c1, char c2) + { + return ::tolower(c1) == ::tolower(c2); + } + ); + } +} // namepsace xmrstak diff --git a/xmrstak/misc/utility.hpp b/xmrstak/misc/utility.hpp new file mode 100644 index 0000000..b2e841d --- /dev/null +++ b/xmrstak/misc/utility.hpp @@ -0,0 +1,12 @@ +#pragma once + +#include <string> + +namespace xmrstak +{ + /** case insensitive string compare + * + * @return true if both strings are equal, else false + */ + bool strcmp_i(const std::string& str1, const std::string& str2); +} // namepsace xmrstak |