Compare commits

..

2 Commits

View File

@@ -31,7 +31,13 @@ User& User::operator=(const User &other)
{ {
if (this != &other) if (this != &other)
{ {
// Copy attributes here fd = other.fd;
nick = other.nick;
username = other.username;
realname = other.realname;
buffer = other.buffer;
authenticated = other.authenticated;
registered = other.registered;
} }
// std::cout << "User copy assignment operator called" << std::endl; // std::cout << "User copy assignment operator called" << std::endl;
return (*this); return (*this);
@@ -44,22 +50,22 @@ User::~User()
// Getters // Getters
int User::getFd() const { return (this->fd) }; int User::getFd() const { return (this->fd); };
std::string User::getNick() const { return (this->nick) }; std::string User::getNick() const { return (this->nick); };
std::string User::getUsername() const { return (this->username) }; std::string User::getUsername() const { return (this->username); };
std::string User::getRealname() const { return (this->realname) }; std::string User::getRealname() const { return (this->realname); };
std::string &User::getBuffer() { return (this->buffer) }; std::string &User::getBuffer() { return (this->buffer); };
bool User::isAuthenticated() const { return (this->authenticated) }; bool User::isAuthenticated() const { return (this->authenticated); };
bool User::isRegistered() const { return (this->registered) }; bool User::isRegistered() const { return (this->registered); };
// Setters // Setters
void setNick(std::string nick) { this->nick = nick; } void User::setNick(std::string nick) { this->nick = nick; }
void setUsername(std::string username) { this->username = username; } void User::setUsername(std::string username) { this->username = username; }
void setRealname(std::string realname) { this->realname = realname; } void User::setRealname(std::string realname) { this->realname = realname; }
void appendBuffer(std::string buff) { this->buffer = buff; } void User::appendBuffer(std::string buff) { this->buffer = buff; }
void clearBuffer() { this->buffer.clear(); } void User::clearBuffer() { this->buffer.clear(); }
void setAuthenticated(bool value) { this->authenticated = value; } void User::setAuthenticated(bool value) { this->authenticated = value; }
void setRegistered(bool value) { this->registered = value; } void User::setRegistered(bool value) { this->registered = value; }