pairpal
Loading...
Searching...
No Matches
dialog.hpp
1#ifndef DIALOG_HPP
2#define DIALOG_HPP
3
4#include <string>
5#include <vector>
6#include <iomanip>
7#include "message.hpp"
8
13class Dialog {
14private:
15 std::vector<Message> messages; // store the messages
16 std::vector<std::string> users; // store the users
17public:
18
19 Dialog();
20
26 Dialog(std::string from, std::string to);
27
32
37 [[nodiscard]] std::string getFromUser() const;
38
43 [[nodiscard]] std::string getToUser() const;
44
49 [[nodiscard]] std::vector<Message> getAllMessages() const;
50
57 bool sendMessage(const std::string& sender, std::string message);
58
59 void displayMessages() const;
60
61
67 bool deleteMessage(size_t index);
68};
69
70#endif // DIALOG_HPP
Represents a dialog between two users.
Definition dialog.hpp:13
std::string getToUser() const
get the username of the receiver
bool sendMessage(const std::string &sender, std::string message)
Sends a message in the dialog.
~Dialog()
Destroy the Dialog object.
std::string getFromUser() const
get the username of the sender
bool deleteMessage(size_t index)
delete a message from the dialog
std::vector< Message > getAllMessages() const
get all messages in the dialog
Dialog(std::string from, std::string to)
Constructs a Dialog object.