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

Implements functions for formatting IRC server replies. [詳解]

#include "Replies.hpp"
#include <cstdarg>
#include <cstdio>
#include <cstring>
Replies.cpp の依存先関係図:

[ソースコード]

関数

std::string formatReply (const std::string &serverName, const std::string &clientNickname, const std::string &replyCodeAndText)
 Formats an IRC reply message without extra parameters.
 
std::string formatReply (const std::string &serverName, const std::string &clientNickname, const std::string &replyCodeAndFormat, const std::vector< std::string > &args)
 Formats an IRC reply message with variable string arguments.
 

詳解

Implements functions for formatting IRC server replies.

This file contains utility functions to format numeric replies and error messages according to the IRC protocol, handling both fixed and variable arguments.

Replies.cpp に定義があります。

関数詳解

◆ formatReply() [1/2]

std::string formatReply ( const std::string serverName,
const std::string clientNickname,
const std::string replyCodeAndFormat,
const std::vector< std::string > &  args 
)

Formats an IRC reply message with variable string arguments.

This function constructs a standard IRC reply string, replacing "%s" placeholders in the replyCodeAndFormat string with the provided arguments. The format is: ":<serverName> <replyCode> <clientNickname> <formattedReplyText>\r\n".

引数
serverNameThe name of the server sending the reply.
clientNicknameThe nickname of the client to whom the reply is directed.
replyCodeAndFormatThe numeric reply code and its printf-style format string (e.g., "002 %s :Your host is %s").
argsA vector of strings to substitute into the format string's "%s" placeholders.
戻り値
The formatted IRC reply string.

Replies.cpp23 行目に定義があります。

◆ formatReply() [2/2]

std::string formatReply ( const std::string serverName,
const std::string clientNickname,
const std::string replyCodeAndText 
)

Formats an IRC reply message without extra parameters.

This function constructs a standard IRC reply string in the format: ":<serverName> <replyCode> <clientNickname> <replyText>\r\n".

引数
serverNameThe name of the server sending the reply.
clientNicknameThe nickname of the client to whom the reply is directed.
replyCodeAndTextThe numeric reply code and its associated fixed text (e.g., "001 :Welcome...").
戻り値
The formatted IRC reply string.

Replies.cpp14 行目に定義があります。