From: David ‘Bombe’ Roden Date: Sat, 5 Jul 2008 12:46:22 +0000 (+0200) Subject: add global settings container X-Git-Tag: 0.1~56 X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=b5365167e09a5a936a42340737ab5d2e538b1e27;p=ecparse.git add global settings container --- diff --git a/GlobalSettings.cpp b/GlobalSettings.cpp new file mode 100644 index 0000000..bbfc11c --- /dev/null +++ b/GlobalSettings.cpp @@ -0,0 +1,27 @@ +/** + * © 2008 by David ‘Bombe’ Roden + */ + +#include "GlobalSettings.h" + +GlobalSettings::GlobalSettings() { + verbose = false; +} + +GlobalSettings::~GlobalSettings() { +} + +GlobalSettings* GlobalSettings::instance = 0; + +GlobalSettings* GlobalSettings::getInstance() { + if (instance) { + return instance; + } + instance = new GlobalSettings(); + return instance; +} + +void GlobalSettings::setVerbose(bool verbose) { + this->verbose = verbose; +} + diff --git a/GlobalSettings.h b/GlobalSettings.h new file mode 100644 index 0000000..cc9df32 --- /dev/null +++ b/GlobalSettings.h @@ -0,0 +1,23 @@ +/** + * © 2008 by David ‘Bombe’ Roden + */ + +#pragma once + +class GlobalSettings { + +private: + GlobalSettings(); + ~GlobalSettings(); + +public: + static GlobalSettings* getInstance(); + + void setVerbose(bool verbose); + +private: + static GlobalSettings* instance; + bool verbose; + +}; +