ft_irc 1.0
読み取り中…
検索中…
一致する文字列を見つけられません
CommandUtils.cpp ファイル

Implements utility functions for command handling. [詳解]

#include "CommandUtils.hpp"
#include "Channel.hpp"
#include "Client.hpp"
#include "Replies.hpp"
#include "Server.hpp"
#include <sstream>
CommandUtils.cpp の依存先関係図:

[ソースコード]

関数

std::vector< std::stringsplit (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 に定義があります。

関数詳解

◆ handleMessage()

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.

引数
serverA pointer to the Server instance.
senderA pointer to the Client sending the message.
commandThe command string (e.g., "PRIVMSG" or "NOTICE").
argsA vector of arguments, where args[0] is the target and args[1] is the message.

CommandUtils.cpp25 行目に定義があります。

◆ split()

std::vector< std::string > split ( const std::string s,
char  delimiter 
)

Splits a string into a vector of strings based on a delimiter.

引数
sThe input string to split.
delimiterThe character used to delimit the string.
戻り値
A vector of strings.

CommandUtils.cpp15 行目に定義があります。