style(user): changing the getter nickname for getName()

This commit is contained in:
Raphael 2025-05-24 17:59:18 +02:00
parent b2c5e0f5d7
commit e742988ca7
6 changed files with 14 additions and 9 deletions

View file

@ -6,7 +6,7 @@
# By: sben-tay <sben-tay@student.42.fr> +#+ +:+ +#+ #
# +#+#+#+#+#+ +#+ #
# Created: 2025/05/02 15:40:00 by rparodi #+# #+# #
# Updated: 2025/05/21 13:01:09 by rparodi ### ########.fr #
# Updated: 2025/05/24 16:48:43 by rparodi ### ########.fr #
# #
# **************************************************************************** #

View file

@ -48,7 +48,7 @@ class User {
- _registered : bool
+ getFd() : int
+ getNickname() : string
+ getName() : string
+ setNickname(name : string) : void
+ appendToReadBuffer(data : string) : void
+ appendToWriteBuffer(data : string) : void

View file

@ -6,7 +6,7 @@
/* By: rparodi <rparodi@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2025/05/20 21:50:32 by rparodi #+# #+# */
/* Updated: 2025/05/21 13:03:01 by rparodi ### ########.fr */
/* Updated: 2025/05/24 16:48:04 by rparodi ### ########.fr */
/* */
/* ************************************************************************** */
@ -14,6 +14,9 @@
#include <string>
#include "PollManager.hpp"
#include <list>
#include "user.hpp"
#include "channel.hpp"
class Server {
private:
@ -25,6 +28,8 @@ class Server {
Server(int port, const std::string &password);
~Server();
void start();
std::list<User *> getUsersList() const;
std::list<Channel *> getChannelsList() const;
unsigned short int getPort() const;
void showInfo() const;
};

View file

@ -28,7 +28,7 @@ class User {
int getFd() const;
bool isReadyToSend() const;
bool isRegistered() const;
std::string getNickname() const;
std::string getName() const;
std::string extractFullCommand();
void appendToReadBuffer(const std::string &data);
void appendToWriteBuffer(const std::string &data);

View file

@ -106,7 +106,7 @@ void Channel::addOperator(User *user) {
this->_operators.push_back(user);
}
else {
std::cerr << user->getNickname() << " is already an operator in the channel " << this->_name << std::endl;
std::cerr << user->getName() << " is already an operator in the channel " << this->_name << std::endl;
}
}
@ -120,7 +120,7 @@ void Channel::addUser(User *user) {
this->_users.push_back(user);
}
else {
std::cerr << user->getNickname() << " is already in the channel " << this->_name << std::endl;
std::cerr << user->getName() << " is already in the channel " << this->_name << std::endl;
}
}
@ -134,7 +134,7 @@ void Channel::removeUser(User *user) {
this->_users.remove(user);
}
else {
std::cerr << user->getNickname() << " is not in the channel " << this->_name << std::endl;
std::cerr << user->getName() << " is not in the channel " << this->_name << std::endl;
}
}
@ -148,7 +148,7 @@ void Channel::removeOperator(User *user) {
this->_operators.remove(user);
}
else {
std::cerr << user->getNickname() << " is not an operator in the channel " << this->_name << std::endl;
std::cerr << user->getName() << " is not an operator in the channel " << this->_name << std::endl;
}
}

View file

@ -26,7 +26,7 @@ int User::getFd() const {
*
* @return the actual nickname of the user
*/
std::string User::getNickname() const {
std::string User::getName() const {
return this->_nickname;
}