Files
ft_irc/User/User.cpp
2026-05-07 10:40:05 +02:00

65 lines
2.4 KiB
C++

/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* User.cpp :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: aortigos <aortigos@student.42malaga.com> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2026/05/07 10:22:52 by aortigos #+# #+# */
/* Updated: 2026/05/07 10:22:52 by aortigos ### ########.fr */
/* */
/* ************************************************************************** */
#include "User.hpp"
//////////////////
// Constructors //
//////////////////
User::User()
{
// std::cout << "User default constructor called" << std::endl;
}
User::User(const User &other)
{
*this = other;
// std::cout << "User copy constructor called" << std::endl;
}
User& User::operator=(const User &other)
{
if (this != &other)
{
// Copy attributes here
}
// std::cout << "User copy assignment operator called" << std::endl;
return (*this);
}
User::~User()
{
// std::cout << "User destructor called" << std::endl;
}
// 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) };
// Setters
void setNick(std::string nick) { this->nick = nick; }
void setUsername(std::string username) { this->username = username; }
void setRealname(std::string realname) { this->realname = realname; }
void appendBuffer(std::string buff) { this->buffer = buff; }
void clearBuffer() { this->buffer.clear(); }
void setAuthenticated(bool value) { this->authenticated = value; }
void setRegistered(bool value) { this->registered = value; }