feat(user): starting the class user

This commit is contained in:
Raphael 2025-05-20 22:17:06 +02:00
parent 4658e6650b
commit 3b09910ead
2 changed files with 112 additions and 0 deletions

36
include/user.hpp Normal file
View file

@ -0,0 +1,36 @@
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* user.hpp :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: rparodi <rparodi@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2025/05/20 21:57:49 by rparodi #+# #+# */
/* Updated: 2025/05/20 22:13:41 by rparodi ### ########.fr */
/* */
/* ************************************************************************** */
#pragma once
#include <string>
#include <iostream>
#include "color.hpp"
class User {
private:
int _fd;
bool _registered;
std::string _nickname;
std::string _hostname;
std::string _read_buffer;
std::string _write_buffer;
public:
int getFd() const;
bool isReadyToSend() const;
bool isRegistered() const;
std::string getNickname() const;
std::string extractFullCommand();
void appendToReadBuffer(const std::string &data);
void appendToWriteBuffer(const std::string &data);
void setNickname(const std::string &nickname);
};