From 4bb1fd148ad294b2221a058be7d3998220f92682 Mon Sep 17 00:00:00 2001 From: Lukas-Heiligenbrunner Date: Tue, 11 Feb 2020 17:14:17 +0100 Subject: [PATCH] moved credential definition in seperate file --- CMakeLists.txt | 2 +- inc/Credentials.h | 24 +++++++----------------- src/Credentials.cpp | 16 ++++++++++++++++ 3 files changed, 24 insertions(+), 18 deletions(-) create mode 100644 src/Credentials.cpp 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()); +}