From da0f943bf34341c15763bc55b6d04ff836e5acf1 Mon Sep 17 00:00:00 2001 From: littleblack111 Date: Fri, 13 Jun 2025 20:20:27 +0800 Subject: style: clang-format --- src/command/commandHandler.cpp | 4 ++-- src/command/commandHandler.hpp | 4 ++-- src/command/commands.cpp | 4 ++-- src/core/chatManager.cpp | 2 +- src/core/chatManager.hpp | 6 +++--- src/core/chatServer.cpp | 6 +++--- src/core/server.cpp | 2 +- src/core/server.hpp | 2 +- src/core/session.cpp | 4 ++-- src/core/session.hpp | 20 ++++++++++---------- src/core/sessionManager.cpp | 4 ++-- src/io/IOManager.cpp | 2 +- src/io/inputManager.cpp | 4 ++-- src/io/inputManager.hpp | 2 +- src/io/renderManager.hpp | 2 +- src/io/scroller.cpp | 2 +- 16 files changed, 35 insertions(+), 35 deletions(-) diff --git a/src/command/commandHandler.cpp b/src/command/commandHandler.cpp index 3baeeb1..45306c2 100644 --- a/src/command/commandHandler.cpp +++ b/src/command/commandHandler.cpp @@ -1,8 +1,8 @@ #include "commandHandler.hpp" -#include "../debug/log.hpp" #include "../core/session.hpp" -#include +#include "../debug/log.hpp" #include "../misc/memory.hpp" +#include CCommandHandler::CCommandHandler() { log(LOG, "CommandHandler: initialized"); diff --git a/src/command/commandHandler.hpp b/src/command/commandHandler.hpp index 5a8636f..51dcaa0 100644 --- a/src/command/commandHandler.hpp +++ b/src/command/commandHandler.hpp @@ -1,9 +1,9 @@ #pragma once #include "../core/session.hpp" +#include "../misc/memory.hpp" #include #include -#include "../misc/memory.hpp" #include #include #include @@ -64,7 +64,7 @@ class CCommandHandler { private: SP getCommand(const std::string &command) const; - SResult exeCommand(const SP command, const std::string &args) const; + SResult exeCommand(const SP command, const std::string &args) const; std::vector> m_vCommands; }; diff --git a/src/command/commands.cpp b/src/command/commands.cpp index 6f3db68..d510fe4 100644 --- a/src/command/commands.cpp +++ b/src/command/commands.cpp @@ -1,8 +1,8 @@ #include "commands.hpp" -#include "commandHandler.hpp" +#include "../core/sessionManager.hpp" #include "../debug/format.hpp" #include "../debug/log.hpp" -#include "../core/sessionManager.hpp" +#include "commandHandler.hpp" #define NOREASON "No reason specified"; diff --git a/src/core/chatManager.cpp b/src/core/chatManager.cpp index e981e7f..e8e4d5f 100644 --- a/src/core/chatManager.cpp +++ b/src/core/chatManager.cpp @@ -1,7 +1,7 @@ #include "chatManager.hpp" +#include "../debug/log.hpp" #include "../io/IOManager.hpp" #include "../io/inputManager.hpp" -#include "../debug/log.hpp" #include "sessionManager.hpp" CChatManager::CChatManager() { diff --git a/src/core/chatManager.hpp b/src/core/chatManager.hpp index d109424..6e1d5a2 100644 --- a/src/core/chatManager.hpp +++ b/src/core/chatManager.hpp @@ -12,10 +12,10 @@ class CChatManager { CChatManager(); ~CChatManager(); struct SMessage { - std::string msg; - std::string username; + std::string msg; + std::string username; std::optional> sender = std::nullopt; - bool admin = false; + bool admin = false; }; void newMessage(const SMessage &msg); std::string fmtBroadcastMessage(const SMessage &msg); diff --git a/src/core/chatServer.cpp b/src/core/chatServer.cpp index 4a16c56..8788301 100644 --- a/src/core/chatServer.cpp +++ b/src/core/chatServer.cpp @@ -1,11 +1,11 @@ #include "chatServer.hpp" -#include "../io/IOManager.hpp" -#include "chatManager.hpp" #include "../command/commandHandler.hpp" #include "../command/commands.hpp" -#include "../io/inputManager.hpp" #include "../debug/log.hpp" +#include "../io/IOManager.hpp" +#include "../io/inputManager.hpp" #include "../io/renderManager.hpp" +#include "chatManager.hpp" #include "server.hpp" #include "sessionManager.hpp" diff --git a/src/core/server.cpp b/src/core/server.cpp index 10eb4dd..d84a38f 100644 --- a/src/core/server.cpp +++ b/src/core/server.cpp @@ -1,7 +1,7 @@ #include "server.hpp" #include "../debug/log.hpp" -#include #include "../misc/memory.hpp" +#include #include CServer::CServer(uint16_t port) diff --git a/src/core/server.hpp b/src/core/server.hpp index ea0e15b..866f141 100644 --- a/src/core/server.hpp +++ b/src/core/server.hpp @@ -12,7 +12,7 @@ class CServer { private: SP m_sockfd; - sockaddr_in m_addr; + sockaddr_in m_addr; mutable std::mutex m_mutex; }; diff --git a/src/core/session.cpp b/src/core/session.cpp index c8cceb0..3b6eacb 100644 --- a/src/core/session.cpp +++ b/src/core/session.cpp @@ -1,15 +1,15 @@ #include "session.hpp" -#include "chatManager.hpp" #include "../command/commandHandler.hpp" #include "../debug/format.hpp" #include "../debug/log.hpp" +#include "../misc/memory.hpp" +#include "chatManager.hpp" #include "server.hpp" #include "sessionManager.hpp" #include #include #include #include -#include "../misc/memory.hpp" #include #include diff --git a/src/core/session.hpp b/src/core/session.hpp index 9a953fc..5ca193c 100644 --- a/src/core/session.hpp +++ b/src/core/session.hpp @@ -1,10 +1,10 @@ #pragma once +#include "../debug/format.hpp" #include "../misc/FileDescriptor.hpp" +#include "../misc/memory.hpp" #include "chatManager.hpp" -#include "../debug/format.hpp" #include -#include "../misc/memory.hpp" #include #include #include @@ -33,7 +33,7 @@ class CSession { UP read(); UP read(const std::string &msg, bool bypassDeaf = false); - bool write(const std::string &msg); + bool write(const std::string &msg); template bool write(std::format_string fmt, Args &&...args); template @@ -57,14 +57,14 @@ class CSession { WRITE }; - WP self; + WP self; SP m_sockfd; - sockaddr_in m_addr; - socklen_t m_addrLen = sizeof(m_addr); - std::string m_name; - std::string m_ip; - int m_port; - bool m_isAdmin = false; + sockaddr_in m_addr; + socklen_t m_addrLen = sizeof(m_addr); + std::string m_name; + std::string m_ip; + int m_port; + bool m_isAdmin = false; std::optional m_szReading = std::nullopt; bool m_bMuted = false; diff --git a/src/core/sessionManager.cpp b/src/core/sessionManager.cpp index e7a786b..221996d 100644 --- a/src/core/sessionManager.cpp +++ b/src/core/sessionManager.cpp @@ -1,8 +1,8 @@ #include "sessionManager.hpp" -#include "../io/IOManager.hpp" -#include "chatServer.hpp" #include "../debug/format.hpp" #include "../debug/log.hpp" +#include "../io/IOManager.hpp" +#include "chatServer.hpp" #include "session.hpp" #include #include diff --git a/src/io/IOManager.cpp b/src/io/IOManager.cpp index be29adf..ce7db5d 100644 --- a/src/io/IOManager.cpp +++ b/src/io/IOManager.cpp @@ -1,6 +1,6 @@ #include "IOManager.hpp" -#include "inputManager.hpp" #include "../debug/log.hpp" +#include "inputManager.hpp" CIOManager::CIOManager() { log(LOG, "IOManager: initialized"); diff --git a/src/io/inputManager.cpp b/src/io/inputManager.cpp index 09a7729..4f508c8 100644 --- a/src/io/inputManager.cpp +++ b/src/io/inputManager.cpp @@ -1,8 +1,8 @@ #include "inputManager.hpp" -#include "IOManager.hpp" -#include "../core/chatManager.hpp" #include "../command/commandHandler.hpp" +#include "../core/chatManager.hpp" #include "../debug/log.hpp" +#include "IOManager.hpp" #include "renderManager.hpp" #include "scroller.hpp" diff --git a/src/io/inputManager.hpp b/src/io/inputManager.hpp index a794ae9..33d40be 100644 --- a/src/io/inputManager.hpp +++ b/src/io/inputManager.hpp @@ -1,7 +1,7 @@ #pragma once -#include #include "../misc/memory.hpp" +#include class CInputManager { public: diff --git a/src/io/renderManager.hpp b/src/io/renderManager.hpp index 3643f3c..474b060 100644 --- a/src/io/renderManager.hpp +++ b/src/io/renderManager.hpp @@ -1,7 +1,7 @@ #pragma once -#include #include "../misc/memory.hpp" +#include class CRenderManager { public: diff --git a/src/io/scroller.cpp b/src/io/scroller.cpp index 9fd1427..63d0b09 100644 --- a/src/io/scroller.cpp +++ b/src/io/scroller.cpp @@ -1,10 +1,10 @@ #include "scroller.hpp" #include "../debug/log.hpp" +#include "../misc/memory.hpp" // for shared_ptr, allocator, __shared_ptr_access #include // for max, min #include // for Component, ComponentBase #include // for Event, Event::ArrowDown, Event::ArrowUp, Event::End, Event::Home, Event::PageDown, Event::PageUp -#include "../misc/memory.hpp" // for shared_ptr, allocator, __shared_ptr_access #include // for move #include "ftxui/component/component.hpp" // for Make -- cgit v1.2.3