1
0
This repository has been archived on 2024-11-25. You can view files and clone it, but cannot push or open issues or pull requests.
CPP_Module_01/ex05/harl.cpp

43 lines
1.6 KiB
C++
Raw Permalink Normal View History

/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* harl.cpp :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: adjoly <adjoly@student.42angouleme.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/11/09 17:15:01 by adjoly #+# #+# */
/* Updated: 2024/11/09 19:16:07 by adjoly ### ########.fr */
/* */
/* ************************************************************************** */
#include "harl.hpp"
#include <iostream>
void Harl::complain(std::string level) {
std::string complainLevel[4] = {"DEBUG", "INFO", "WARNING", "ERROR"};
void (Harl::*func[4])(void) = {&Harl::debug, &Harl::info, &Harl::warning, &Harl::error};
uint8_t i = 0;
while (i < 4 && level != complainLevel[i])
i++;
if (i < 4)
(this->*func[i])();
return ;
}
void Harl::debug(void) {
std::cout << "[DEBUG]: NixOS is the only true answer" << std::endl;
}
void Harl::info(void) {
std::cout << "[INFO]: NixOS is on 24.05" << std::endl;
}
void Harl::warning(void) {
std::cout << "[WARNING]: Please no Ubuntu here" << std::endl;
}
void Harl::error(void) {
std::cout << "[ERROR]: Arch issue switch to NixOS please for god sake" << std::endl;
}