style(user): changing the getter nickname for getName()
This commit is contained in:
parent
b2c5e0f5d7
commit
e742988ca7
6 changed files with 14 additions and 9 deletions
2
Makefile
2
Makefile
|
|
@ -6,7 +6,7 @@
|
||||||
# By: sben-tay <sben-tay@student.42.fr> +#+ +:+ +#+ #
|
# By: sben-tay <sben-tay@student.42.fr> +#+ +:+ +#+ #
|
||||||
# +#+#+#+#+#+ +#+ #
|
# +#+#+#+#+#+ +#+ #
|
||||||
# Created: 2025/05/02 15:40:00 by rparodi #+# #+# #
|
# 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 #
|
||||||
# #
|
# #
|
||||||
# **************************************************************************** #
|
# **************************************************************************** #
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -48,7 +48,7 @@ class User {
|
||||||
- _registered : bool
|
- _registered : bool
|
||||||
|
|
||||||
+ getFd() : int
|
+ getFd() : int
|
||||||
+ getNickname() : string
|
+ getName() : string
|
||||||
+ setNickname(name : string) : void
|
+ setNickname(name : string) : void
|
||||||
+ appendToReadBuffer(data : string) : void
|
+ appendToReadBuffer(data : string) : void
|
||||||
+ appendToWriteBuffer(data : string) : void
|
+ appendToWriteBuffer(data : string) : void
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@
|
||||||
/* By: rparodi <rparodi@student.42.fr> +#+ +:+ +#+ */
|
/* By: rparodi <rparodi@student.42.fr> +#+ +:+ +#+ */
|
||||||
/* +#+#+#+#+#+ +#+ */
|
/* +#+#+#+#+#+ +#+ */
|
||||||
/* Created: 2025/05/20 21:50:32 by rparodi #+# #+# */
|
/* 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 <string>
|
||||||
#include "PollManager.hpp"
|
#include "PollManager.hpp"
|
||||||
|
#include <list>
|
||||||
|
#include "user.hpp"
|
||||||
|
#include "channel.hpp"
|
||||||
|
|
||||||
class Server {
|
class Server {
|
||||||
private:
|
private:
|
||||||
|
|
@ -25,6 +28,8 @@ class Server {
|
||||||
Server(int port, const std::string &password);
|
Server(int port, const std::string &password);
|
||||||
~Server();
|
~Server();
|
||||||
void start();
|
void start();
|
||||||
|
std::list<User *> getUsersList() const;
|
||||||
|
std::list<Channel *> getChannelsList() const;
|
||||||
unsigned short int getPort() const;
|
unsigned short int getPort() const;
|
||||||
void showInfo() const;
|
void showInfo() const;
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -28,7 +28,7 @@ class User {
|
||||||
int getFd() const;
|
int getFd() const;
|
||||||
bool isReadyToSend() const;
|
bool isReadyToSend() const;
|
||||||
bool isRegistered() const;
|
bool isRegistered() const;
|
||||||
std::string getNickname() const;
|
std::string getName() const;
|
||||||
std::string extractFullCommand();
|
std::string extractFullCommand();
|
||||||
void appendToReadBuffer(const std::string &data);
|
void appendToReadBuffer(const std::string &data);
|
||||||
void appendToWriteBuffer(const std::string &data);
|
void appendToWriteBuffer(const std::string &data);
|
||||||
|
|
|
||||||
|
|
@ -106,7 +106,7 @@ void Channel::addOperator(User *user) {
|
||||||
this->_operators.push_back(user);
|
this->_operators.push_back(user);
|
||||||
}
|
}
|
||||||
else {
|
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);
|
this->_users.push_back(user);
|
||||||
}
|
}
|
||||||
else {
|
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);
|
this->_users.remove(user);
|
||||||
}
|
}
|
||||||
else {
|
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);
|
this->_operators.remove(user);
|
||||||
}
|
}
|
||||||
else {
|
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;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -26,7 +26,7 @@ int User::getFd() const {
|
||||||
*
|
*
|
||||||
* @return the actual nickname of the user
|
* @return the actual nickname of the user
|
||||||
*/
|
*/
|
||||||
std::string User::getNickname() const {
|
std::string User::getName() const {
|
||||||
return this->_nickname;
|
return this->_nickname;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue