DynuIPRefresher/inc/Config.h

86 lines
1.7 KiB
C
Raw Normal View History

/**
* A static class to manage the configuration file, read/write parameters to it.
*
* @author Lukas Heiligenbrunner
* @date 11.02.2020
*/
#pragma once
#include <string>
2020-04-30 17:37:11 +00:00
class Config {
public:
/**
* read configuration out of config file
*
* @return success of config read
*/
static bool readConfig();
/**
* validate config file
*
* @return validity of config file
*/
static bool validateConfig();
/**
* check if telegram credentials in config are set
* @return is supported?
*/
static bool isTelegramSupported();
/** Getters **/
/**
* encapsulated getter for DynuApiKey
* @return api key
*/
static const std::string &getDynuapikey();
/**
* encapsulated getter for DomainId
* @return DomainId
*/
static const std::string &getDomainid();
/**
* encapsulated getter for Domainname
* @return Domainname
*/
static const std::string &getDomainname();
/**
* encapsulated getter for TelegramApiKey
* @return TelegramApiKey
*/
static const std::string &getTelegramApiKey();
/**
* encapsulated getter for ChatId
* @return ChatId
*/
static const std::string &getChatId();
private:
/**
* private constructor --> don't allow instance of this class
*/
Config();
/**
* helper variable for managing telegram Support
*/
static bool telegramSupport;
/**
* helper variables for storing keys and ids
*/
static std::string dynuapikey;
static std::string domainid; //id of the dynu domain
static std::string domainname;
static std::string telegramApiKey;
static std::string chatId;
};