diff --git a/CMakeLists.txt b/CMakeLists.txt index 7710028..a1768b5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -86,7 +86,7 @@ add_library(logger ${LIB_METHOD} set(SOURCE src/main.cpp src/IPRefresher.cpp - ) + src/Credentials.cpp) add_executable(iprefresher ${SOURCE}) diff --git a/inc/Credentials.h b/inc/Credentials.h index 1e82694..3bbc1c8 100644 --- a/inc/Credentials.h +++ b/inc/Credentials.h @@ -4,29 +4,19 @@ #pragma once - #include class Credentials { public: - static const std::string dynuapikey; + static std::string dynuapikey; - static const std::string domainid; //id of the dynu domain - static const std::string domainname; + static std::string domainid; //id of the dynu domain + static std::string domainname; - static const std::string telegramApiKey; - static const std::string chatId; + static std::string telegramApiKey; + static std::string chatId; static bool checkCredentialValidity(); -}; -const std::string Credentials::dynuapikey = ""; -const std::string Credentials::domainid = ""; //id of the dynu domain -const std::string Credentials::domainname = ""; - -static const std::string Credentials::telegramApiKey = ""; -static const std::string Credentials::chatId = ""; - -bool Credentials::checkCredentialValidity() { - return !(dynuapikey.empty() || domainid.empty() || domainname.empty()); -} +private: +}; \ No newline at end of file diff --git a/src/Credentials.cpp b/src/Credentials.cpp new file mode 100644 index 0000000..9ae7227 --- /dev/null +++ b/src/Credentials.cpp @@ -0,0 +1,16 @@ +// +// Created by lukas on 11.02.20. +// + +#include + +std::string Credentials::dynuapikey = ""; +std::string Credentials::domainid = ""; //id of the dynu domain +std::string Credentials::domainname = ""; + +std::string Credentials::telegramApiKey = ""; +std::string Credentials::chatId = ""; + +bool Credentials::checkCredentialValidity() { + return !(Credentials::dynuapikey.empty() || Credentials::domainid.empty() || Credentials::domainname.empty()); +}