summaryrefslogtreecommitdiff
path: root/src/io/IOManager.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/io/IOManager.hpp')
-rw-r--r--src/io/IOManager.hpp33
1 files changed, 33 insertions, 0 deletions
diff --git a/src/io/IOManager.hpp b/src/io/IOManager.hpp
new file mode 100644
index 0000000..d1d891d
--- /dev/null
+++ b/src/io/IOManager.hpp
@@ -0,0 +1,33 @@
+#pragma once
+
+#include "../core/chatManager.hpp"
+#include "../debug/format.hpp"
+#include <optional>
+
+class CIOManager {
+ public:
+ CIOManager();
+ ~CIOManager();
+
+ struct SLog {
+ eFormatType type;
+ std::string log;
+ };
+ struct SIO {
+ // once a time
+ std::optional<CChatManager::SMessage> msg = std::nullopt;
+ std::optional<SLog> log = std::nullopt;
+ std::optional<std::pair<std::string, std::string>> custom = std::nullopt;
+ };
+
+ const std::vector<SIO> &getIO() const;
+ void addLog(const SLog &log);
+ void addMessage(const CChatManager::SMessage &msg);
+ void addCustom(const std::pair<std::string, std::string> &custom);
+
+ private:
+ std::vector<SIO> m_vIO;
+
+ friend class CChatManager;
+};
+inline std::unique_ptr<CIOManager> g_pIOManager;