diff --git a/compile_linux.sh b/compile_linux.sh index ad613be..f7eb992 100755 --- a/compile_linux.sh +++ b/compile_linux.sh @@ -1 +1,3 @@ -g++ -o3 -g main.cpp ./core/settings.cpp ./core/request.cpp ./core/http_server.cpp ./core/file_cache.cpp ./core/application.cpp ./rdn_application.cpp -o ./bin/server -Ilibs -lpthread -std=c++11 +g++ -o3 -g main.cpp ./core/settings.cpp ./core/request.cpp ./core/http_server.cpp ./core/file_cache.cpp ./core/application.cpp ./rdn_application.cpp \ + ./themes/theme.cpp ./themes/theme_map.cpp \ + -o ./bin/server -Ilibs -lpthread -std=c++11 diff --git a/themes/theme.cpp b/themes/theme.cpp new file mode 100644 index 0000000..2476bdc --- /dev/null +++ b/themes/theme.cpp @@ -0,0 +1,9 @@ +#include "theme.h" + +Theme::Theme() { + +} + +Theme::~Theme() { + +} diff --git a/themes/theme.h b/themes/theme.h new file mode 100644 index 0000000..0a71c13 --- /dev/null +++ b/themes/theme.h @@ -0,0 +1,23 @@ +#ifndef THEME_H +#define THEME_H + +#include +#include + +class Theme { +public: + + + Theme(); + virtual ~Theme(); +}; + + +//forumtheme +//sitetheme +//... +//all singleton +//not templated +//and a theme map + +#endif \ No newline at end of file diff --git a/themes/theme_map.cpp b/themes/theme_map.cpp new file mode 100644 index 0000000..15b9e5d --- /dev/null +++ b/themes/theme_map.cpp @@ -0,0 +1,15 @@ +#include "theme_map.h" + +ThemeMap::ThemeMap() { + _instance = this; +} + +ThemeMap::~ThemeMap() { + _instance = nullptr; +} + +ThemeMap *ThemeMap::get_singleton() { + return _instance; +} + +ThemeMap *ThemeMap::_instance = nullptr; \ No newline at end of file diff --git a/themes/theme_map.h b/themes/theme_map.h new file mode 100644 index 0000000..41b36d1 --- /dev/null +++ b/themes/theme_map.h @@ -0,0 +1,28 @@ +#ifndef THEME_MAP_H +#define THEME_MAP_H + +#ifndef THEME_CLASS_INCLUDE +#define THEME_CLASS_INCLUDE "theme.h" +#endif + +#ifndef THEME_CLASS +#define THEME_CLASS Theme +#endif + +#include THEME_CLASS_INCLUDE + +class ThemeMap { +public: + THEME_CLASS *current_theme; + std::map theme_map; + + ThemeMap(); + ~ThemeMap(); + + static ThemeMap *get_singleton(); + +private: + static ThemeMap *_instance; +}; + +#endif \ No newline at end of file