fix(commands/cmd): fixing the compilation errors missing the lists part

This commit is contained in:
Raphael 2025-05-26 18:26:59 +02:00
parent 29a3bb114b
commit a2b5793e19
9 changed files with 27 additions and 74 deletions

View file

@ -6,7 +6,7 @@
/* By: rparodi <rparodi@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2025/05/20 23:31:58 by rparodi #+# #+# */
/* Updated: 2025/05/26 16:28:58 by rparodi ### ########.fr */
/* Updated: 2025/05/26 18:25:49 by rparodi ### ########.fr */
/* */
/* ************************************************************************** */
@ -21,7 +21,7 @@
namespace cmd
{
void dispatch(User *user, Channel *channel, const std::string &line);
void dispatch(User *user, Channel *channel, Server *server, const std::string &line);
std::vector<std::string> split(const std::string &line);
template <typename T>
T searchList(const std::list<T> &list, const std::string &name);

View file

@ -6,7 +6,7 @@
/* By: rparodi <rparodi@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2025/05/24 17:34:30 by rparodi #+# #+# */
/* Updated: 2025/05/26 16:14:24 by rparodi ### ########.fr */
/* Updated: 2025/05/26 18:20:34 by rparodi ### ########.fr */
/* */
/* ************************************************************************** */
@ -22,7 +22,7 @@
*/
template <typename T>
T cmd::searchList(const std::list<T> &list, const std::string &name) {
for (typename std::list<T>::iterator it = list.begin(); it != list.end(); ++it) {
for (typename std::list<T>::const_iterator it = list.begin(); it != list.end(); ++it) {
if ((*it)->getName() == name)
return *it;
}

View file

@ -6,7 +6,7 @@
/* By: rparodi <rparodi@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2025/05/15 12:25:58 by rparodi #+# #+# */
/* Updated: 2025/05/15 12:38:10 by rparodi ### ########.fr */
/* Updated: 2025/05/26 18:08:50 by rparodi ### ########.fr */
/* */
/* ************************************************************************** */
@ -15,20 +15,14 @@
#include <iostream>
#include "color.hpp"
#define DEBUG_MSG(str) "print_debug(str, __FILE__, __LINE__)"
#define ERROR_MSG(str) "print_error(str, __FILE__, __LINE__)"
#define WARNING_MSG(str) "print_warning(str, __FILE__, __LINE__)"
#define INFO_MSG(str) "print_info(str, __FILE__, __LINE__)"
#define SUCCESS_MSG(str) "print_success(str, __FILE__, __LINE__)"
#define DEBUG_MSG(str) std::cerr << CLR_CYAN << "\tDebug: " << str << "(" << __FILE__ << ":" << __LINE__ << ")" << CLR_RESET << std::endl;
#define ERROR_MSG(str) std::cerr << CLR_RED << "\tError: " << str << "(" << __FILE__ << ":" << __LINE__ << ")" << CLR_RESET << std::endl;
#define WARNING_MSG(str) std::cerr << CLR_YELLOW << "\tWarning: " << str << "(" << __FILE__ << ":" << __LINE__ << ")" << CLR_RESET << std::endl;
#define INFO_MSG(str) std::cerr << CLR_GREY << "\tInfo: " << str << "(" << __FILE__ << ":" << __LINE__ << ")" << CLR_RESET << std::endl;
#define SUCCESS_MSG(str) std::cerr << CLR_GREEN << "\tSuccess: " << str << "(" << __FILE__ << ":" << __LINE__ << ")" << CLR_RESET << std::endl;
#ifndef DEBUG
#define DEBUG 0
#define LOG ""
#endif
void print_debug(const char *str, const char *file, int line);
void print_error(const char *str, const char *file, int line);
void print_warning(const char *str, const char *file, int line);
void print_info(const char *str, const char *file, int line);
void print_success(const char *str, const char *file, int line);

View file

@ -6,13 +6,13 @@
/* By: omoudni <omoudni@student.42paris.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2025/05/20 21:57:49 by rparodi #+# #+# */
/* Updated: 2025/05/26 16:16:01 by rparodi ### ########.fr */
/* Updated: 2025/05/26 18:10:24 by rparodi ### ########.fr */
/* */
/******************************************************************************/
#pragma once
#include "core.hpp"
#include <string>
class User
{