diff options
Diffstat (limited to 'src/crepe/api')
-rw-r--r-- | src/crepe/api/SaveManager.cpp | 11 | ||||
-rw-r--r-- | src/crepe/api/SaveManager.h | 11 |
2 files changed, 21 insertions, 1 deletions
diff --git a/src/crepe/api/SaveManager.cpp b/src/crepe/api/SaveManager.cpp index a05e2c7..83ff0fa 100644 --- a/src/crepe/api/SaveManager.cpp +++ b/src/crepe/api/SaveManager.cpp @@ -1,8 +1,19 @@ +#include "../DB.h" +#include "util/log.h" + #include "SaveManager.h" +using namespace std; +using namespace crepe; using namespace crepe::api; +SaveManager::SaveManager() { + dbg_trace(); + this->db = make_unique<DB>("./save.crepe.db"); +} + SaveManager & SaveManager::get_instance() { + dbg_trace(); static SaveManager instance; return instance; } diff --git a/src/crepe/api/SaveManager.h b/src/crepe/api/SaveManager.h index 78cd4ba..110735d 100644 --- a/src/crepe/api/SaveManager.h +++ b/src/crepe/api/SaveManager.h @@ -1,7 +1,13 @@ #pragma once +#include <memory> + #include "../ValueBroker.h" +namespace crepe { +class DB; +} + namespace crepe::api { class SaveManager { @@ -22,7 +28,7 @@ public: bool has(const char * key); private: - SaveManager() = default; + SaveManager(); virtual ~SaveManager() = default; public: @@ -32,6 +38,9 @@ public: SaveManager(SaveManager &&) = delete; SaveManager & operator = (const SaveManager &) = delete; SaveManager & operator = (SaveManager &&) = delete; + +private: + std::unique_ptr<DB> db = nullptr; }; } |