From c7d826e738e55005cd4701d69d211123ef0a0b4c Mon Sep 17 00:00:00 2001 From: Raphael Date: Tue, 20 May 2025 23:42:33 +0200 Subject: [PATCH] feat(commands): starting the namespace and abstract class --- include/commands.hpp | 52 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 include/commands.hpp diff --git a/include/commands.hpp b/include/commands.hpp new file mode 100644 index 0000000..ebc4d31 --- /dev/null +++ b/include/commands.hpp @@ -0,0 +1,52 @@ +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* commands.hpp :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: rparodi +#+ +:+ +#+ */ +/* +#+#+#+#+#+ +#+ */ +/* Created: 2025/05/20 23:31:58 by rparodi #+# #+# */ +/* Updated: 2025/05/20 23:41:28 by rparodi ### ########.fr */ +/* */ +/* ************************************************************************** */ + +#pragma once + +#include +#include +#include "user.hpp" + +namespace cmd +{ + void dispatch(User user, const std::string &line); + std::vector split(const std::string &line); + + class ACommand { + private: + std::string _command; + std::vector _args; + User _user; + public: + virtual bool execute() = 0; + ~ACommand(); + ACommand(User user, const std::string &line); + }; + + class Invite; + class Join; + class Kick; + class List; + class Mode; + class Mode; + class Nick; + class Notice; + class Part; + class Pass; + class Ping; + class Pong; + class PrivMsg; + class Quit; + class Topic; + class Unknown; + class User; +};