feat(cmd/mode): mode parsing is now ok
This commit is contained in:
parent
da15fff2d6
commit
ef4db94508
2 changed files with 166 additions and 0 deletions
44
include/commands/modes.hpp
Normal file
44
include/commands/modes.hpp
Normal file
|
|
@ -0,0 +1,44 @@
|
|||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* ::: :::::::: */
|
||||
/* modes.hpp :+: :+: :+: */
|
||||
/* +:+ +:+ +:+ */
|
||||
/* By: rparodi <rparodi@student.42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2025/05/24 17:17:31 by rparodi #+# #+# */
|
||||
/* Updated: 2025/06/10 13:32:34 by rparodi ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "commands.hpp"
|
||||
#include <string>
|
||||
#include <utility>
|
||||
#include <vector>
|
||||
|
||||
enum e_mode {
|
||||
ERROR_MODE = 0,
|
||||
CHAN_INVITE_ONLY,
|
||||
CHAN_SET_TOPIC,
|
||||
CHAN_SET_KEY,
|
||||
CHAN_SET_LIMIT,
|
||||
CHAN_SET_OP,
|
||||
};
|
||||
|
||||
typedef struct s_mode {
|
||||
std::string arguments;
|
||||
e_mode mode;
|
||||
bool add;
|
||||
bool remove;
|
||||
} t_mode;
|
||||
|
||||
class cmd::Mode : public ACommand {
|
||||
public:
|
||||
Mode(User *user, Channel *channel, Server *server, std::string &line) : ACommand(user, channel, server, line) {}
|
||||
virtual void execute(void);
|
||||
virtual e_code checkArgs();
|
||||
void checkMode();
|
||||
private:
|
||||
std::vector<std::pair<bool, s_mode> > _mode;
|
||||
};
|
||||
Loading…
Add table
Add a link
Reference in a new issue