summaryrefslogtreecommitdiff
path: root/src/IOManager.hpp
diff options
context:
space:
mode:
authorlittleblack111 <littleblack11111@gmail.com>2025-04-02 18:49:15 +0800
committerlittleblack111 <littleblack11111@gmail.com>2025-04-07 16:32:07 +0800
commiteff21ee2ce1fdb4328d71d801352ec25f4e457ff (patch)
treef2b3febdbd84ca7e7b799f04a407bf408719c93e /src/IOManager.hpp
parent50de5f9b80f1859b6eaa3b68c10a3f1cfb994737 (diff)
feat: ftxui (#17)
* ready for merge rm sum random ocmments first and https://github.com/ArthurSonzogni/FTXUI/issues/1024 but still, ready for merge since we can't do anything on our end * style: clang-tidy * ci * ci * style: clang-tidy * fix * fix: scroll https://github.com/ArthurSonzogni/git-tui/blob/master/src/scroller.cpp * focus * update todo * style: clang-format * update todo * sticky scroll * update todxo * smol fix need event to update screen. so we just give event when IO updates * style: clang-format --------- Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Diffstat (limited to 'src/IOManager.hpp')
-rw-r--r--src/IOManager.hpp30
1 files changed, 30 insertions, 0 deletions
diff --git a/src/IOManager.hpp b/src/IOManager.hpp
new file mode 100644
index 0000000..ba741ff
--- /dev/null
+++ b/src/IOManager.hpp
@@ -0,0 +1,30 @@
+#pragma once
+
+#include "chatManager.hpp"
+#include "format.hpp"
+#include <optional>
+
+class CIOManager {
+ public:
+ CIOManager();
+ ~CIOManager();
+
+ struct SLog {
+ eFormatType type;
+ std::string log;
+ };
+ struct SIO {
+ // cannot have both at once
+ std::optional<CChatManager::SMessage> msg;
+ std::optional<SLog> log;
+ };
+
+ const std::vector<SIO> &getIO() const;
+ void addLog(const SLog &log);
+
+ private:
+ std::vector<SIO> m_vIO;
+
+ friend class CChatManager;
+};
+inline std::unique_ptr<CIOManager> g_pIOManager;