|
ft_irc 1.0
|
Utility functions for command handling. [詳解]


関数 | |
| void | handleMessage (Server *server, Client *sender, const std::string &command, const std::vector< std::string > &args) |
| Handles sending messages to a target (user or channel) for PRIVMSG and NOTICE commands. | |
| std::vector< std::string > | split (const std::string &s, char delimiter) |
| Splits a string into a vector of strings based on a delimiter. | |
Utility functions for command handling.
This file provides utility functions used across various IRC commands, such as message parsing and string manipulation.
CommandUtils.hpp に定義があります。
| void handleMessage | ( | Server * | server, |
| Client * | sender, | ||
| const std::string & | command, | ||
| const std::vector< std::string > & | args | ||
| ) |
Handles sending messages to a target (user or channel) for PRIVMSG and NOTICE commands.
This function centralizes the logic for sending messages, including error checking for recipients, channel membership, and channel modes.
| server | A pointer to the Server instance. |
| sender | A pointer to the Client sending the message. |
| command | The command string (e.g., "PRIVMSG" or "NOTICE"). |
| args | A vector of arguments, where args[0] is the target and args[1] is the message. |
CommandUtils.cpp の 25 行目に定義があります。
| std::vector< std::string > split | ( | const std::string & | s, |
| char | delimiter | ||
| ) |
Splits a string into a vector of strings based on a delimiter.
| s | The input string to split. |
| delimiter | The character used to delimit the string. |
CommandUtils.cpp の 15 行目に定義があります。