|
ft_irc 1.0
|
Implements utility functions for command handling. [詳解]
#include "CommandUtils.hpp"#include "Channel.hpp"#include "Client.hpp"#include "Replies.hpp"#include "Server.hpp"#include <sstream>
関数 | |
| std::vector< std::string > | split (const std::string &s, char delimiter) |
| Splits a string into a vector of strings based on a delimiter. | |
| 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. | |
Implements utility functions for command handling.
This file contains the implementation of utility functions such as split for string manipulation and handleMessage for processing PRIVMSG and NOTICE commands.
CommandUtils.cpp に定義があります。
| 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 行目に定義があります。