summaryrefslogtreecommitdiff
path: root/src/io/IOManager.hpp
blob: 95eb27bfbbf31641ff6127b8d0f2ae605231d1f2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
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 UP<CIOManager> g_pIOManager;