A class to handle Chat_test functionalities including sending and retrieving messages.
More...
#include <chat.hpp>
|
|
| Chat () |
| | Constructor for the Chat class.
|
| |
|
| ~Chat () |
| | Destructor for the Chat class.
|
| |
| bool | sendMessage (const std::string &from, const std::string &to, const std::string &message) |
| | Sends a message from one user to another.
|
| |
| std::vector< Message > | getSentMessages (const std::string &username) const |
| | Retrieves the messages sent by a specific user.
|
| |
| std::vector< Message > | getReceivedMessages (const std::string &username) const |
| | Retrieves the messages received by a specific user.
|
| |
A class to handle Chat_test functionalities including sending and retrieving messages.
◆ getReceivedMessages()
| std::vector< Message > Chat::getReceivedMessages |
( |
const std::string & | username | ) |
const |
|
nodiscard |
Retrieves the messages received by a specific user.
- Parameters
-
| username | The username of the receiver. |
- Returns
- A vector of messages received by the specified user.
◆ getSentMessages()
| std::vector< Message > Chat::getSentMessages |
( |
const std::string & | username | ) |
const |
|
nodiscard |
Retrieves the messages sent by a specific user.
- Parameters
-
| username | The username of the sender. |
- Returns
- A vector of messages sent by the specified user.
◆ sendMessage()
| bool Chat::sendMessage |
( |
const std::string & | from, |
|
|
const std::string & | to, |
|
|
const std::string & | message ) |
Sends a message from one user to another.
- Parameters
-
| from | The username of the sender. |
| to | The username of the receiver. |
| message | The content of the message to be sent. |
- Returns
- True if the message was sent successfully, false otherwise.
The documentation for this class was generated from the following file: