Merged changes

This commit is contained in:
iherman-
2026-05-10 20:24:20 +02:00
5 changed files with 205 additions and 61 deletions

View File

@@ -18,7 +18,7 @@
User::User() : fd(-1), nick(""), username(""), realname(""), buffer(""), authenticated(false), registered(false)
{
// std::cout << "User default constructor called" << std::endl;
// std::cout << "User default constructor called" << std::endl;
}
User::User(int fd) : fd(fd), nick(""), username(""), realname(""), buffer(""), authenticated(false), registered(false)
@@ -28,8 +28,8 @@ User::User(int fd) : fd(fd), nick(""), username(""), realname(""), buffer(""), a
User::User(const User &other)
{
*this = other;
// std::cout << "User copy constructor called" << std::endl;
*this = other;
// std::cout << "User copy constructor called" << std::endl;
}
User& User::operator=(const User &other)
@@ -55,22 +55,23 @@ User::~User()
// Getters
int User::getFd() const { return (this->fd); };
std::string User::getNick() const { return (this->nick); };
std::string User::getUsername() const { return (this->username); };
std::string User::getRealname() const { return (this->realname); };
std::string &User::getBuffer() { return (this->buffer); };
bool User::isAuthenticated() const { return (this->authenticated); };
bool User::isRegistered() const { return (this->registered); };
int User::getFd() const { return (this->fd); }
std::string User::getNick() const { return (this->nick); }
std::string User::getUsername() const { return (this->username); }
std::string User::getRealname() const { return (this->realname); }
std::string &User::getBuffer() { return (this->buffer); }
bool User::isAuthenticated() const { return (this->authenticated); }
bool User::isRegistered() const { return (this->registered); }
// Setters
void User::setNick(std::string nick) { this->nick = nick; }
void User::setUsername(std::string username) { this->username = username; }
void User::setRealname(std::string realname) { this->realname = realname; }
void User::appendBuffer(std::string buff) { this->buffer = buff; }
void User::clearBuffer() { this->buffer.clear(); }
void User::appendBuffer(std::string buff) { this->buffer.append(buff); }
void User::clearBuffer() { this->buffer.clear(); }
void User::setAuthenticated(bool value) { this->authenticated = value; }
void User::setRegistered(bool value) { this->registered = value; }
void User::setNick(std::string nick) { this->nick = nick; }
void User::setUsername(std::string username) { this->username = username; }
void User::setRealname(std::string realname) { this->realname = realname; }
void User::setAuthenticated(bool value) { this->authenticated = value; }
void User::setRegistered(bool value) { this->registered = value; }