You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
55 lines
1.6 KiB
55 lines
1.6 KiB
/* ************************************************************************** */
|
|
/* */
|
|
/* ::: :::::::: */
|
|
/* Harl.cpp :+: :+: :+: */
|
|
/* +:+ +:+ +:+ */
|
|
/* By: narnaud <narnaud@student.42.fr> +#+ +:+ +#+ */
|
|
/* +#+#+#+#+#+ +#+ */
|
|
/* Created: 2022/06/17 11:14:29 by narnaud #+# #+# */
|
|
/* Updated: 2022/06/20 09:30:23 by narnaud ### ########.fr */
|
|
/* */
|
|
/* ************************************************************************** */
|
|
|
|
#include "Harl.hpp"
|
|
|
|
Harl::Harl (void) {
|
|
std::cout << "Harl default constructor called " << std::endl;
|
|
}
|
|
|
|
Harl::~Harl (void) {
|
|
|
|
std::cout << "Harl default destructor called" << std::endl;
|
|
}
|
|
|
|
void Harl::_debug(void)
|
|
{
|
|
std::cout << "Debug : ..." << std::endl;
|
|
}
|
|
|
|
void Harl::_info(void)
|
|
{
|
|
std::cout << "Info: ..." << std::endl;
|
|
}
|
|
|
|
void Harl::_warning(void)
|
|
{
|
|
std::cout << "Warning: ..." << std::endl;
|
|
}
|
|
|
|
void Harl::_error(void)
|
|
{
|
|
std::cout << "Error: ..." << std::endl;
|
|
}
|
|
|
|
void Harl::_complain(string level) {
|
|
|
|
void (Harl::*fct[4])(void) = {
|
|
&Harl::_debug, &Harl::_info, &Harl::_warning, &Harl::_error};
|
|
string ids = "DIWE";
|
|
int i = 0;
|
|
while (ids[i] && ids[i] != level[0])
|
|
i++;
|
|
if (ids[i])
|
|
(this->*fct[i])();
|
|
}
|
|
|
|
|