Represents a message exchanged between two users.  
 More...
#include <message.hpp>
|  | 
|  | Message (std::string from, std::string to, std::string message) | 
|  | construct a Message object 
 | 
|  | 
|  | ~Message () | 
|  | destroy the Message object 
 | 
|  | 
| std::string | getFromUser () const | 
|  | Gets the username of the sender. 
 | 
|  | 
| std::string | getToUser () const | 
|  | Gets the username of the receiver. 
 | 
|  | 
| std::string | getMessage () const | 
|  | Gets the content of the message. 
 | 
|  | 
| std::string | toString () const | 
|  | Converts the message to a string representation. 
 | 
|  | 
| std::chrono::system_clock::time_point | getTimestamp () const | 
|  | Gets the timestamp of when the message was sent. 
 | 
|  | 
| std::string | getFormatTimestamp () const | 
|  | Converts the timestamp to a string representation. 
 | 
|  | 
Represents a message exchanged between two users. 
◆ Message()
      
        
          | Message::Message | ( | std::string | from, | 
        
          |  |  | std::string | to, | 
        
          |  |  | std::string | message ) | 
      
 
construct a Message object 
- Parameters
- 
  
    | from | the username of the sender |  | to | the username of the receiver |  | message | the content of the message |  
 
 
 
◆ getFormatTimestamp()
  
  | 
        
          | std::string Message::getFormatTimestamp | ( |  | ) | const |  | nodiscard | 
 
Converts the timestamp to a string representation. 
- Returns
- A string representation of the timestamp. 
 
 
◆ getFromUser()
  
  | 
        
          | std::string Message::getFromUser | ( |  | ) | const |  | nodiscard | 
 
Gets the username of the sender. 
- Returns
- The username of the sender. 
 
 
◆ getMessage()
  
  | 
        
          | std::string Message::getMessage | ( |  | ) | const |  | nodiscard | 
 
Gets the content of the message. 
- Returns
- The content of the message. 
 
 
◆ getTimestamp()
  
  | 
        
          | std::chrono::system_clock::time_point Message::getTimestamp | ( |  | ) | const |  | nodiscard | 
 
Gets the timestamp of when the message was sent. 
- Returns
- The timestamp of the message. 
 
 
◆ getToUser()
  
  | 
        
          | std::string Message::getToUser | ( |  | ) | const |  | nodiscard | 
 
Gets the username of the receiver. 
- Returns
- The username of the receiver. 
 
 
◆ toString()
  
  | 
        
          | std::string Message::toString | ( |  | ) | const |  | nodiscard | 
 
Converts the message to a string representation. 
- Returns
- A string representation of the message. 
 
 
The documentation for this class was generated from the following file: