From: Lukas Jiriste Date: Fri, 11 Oct 2024 11:19:33 +0000 (+0200) Subject: Change recognized levels to upper case in ex05 X-Git-Url: https://git.ljiriste.work/?a=commitdiff_plain;h=90d758be717652f5372469f02c296025dc1c0b82;p=42%2FCPP_Module_01 Change recognized levels to upper case in ex05 --- diff --git a/ex05/Harl.cpp b/ex05/Harl.cpp index b060fd9..2f89f80 100644 --- a/ex05/Harl.cpp +++ b/ex05/Harl.cpp @@ -5,13 +5,13 @@ Harl::Harl() { - m_levels[0] = "debug"; + m_levels[0] = "DEBUG"; m_speech[0] = &Harl::debug; - m_levels[1] = "info"; + m_levels[1] = "INFO"; m_speech[1] = &Harl::info; - m_levels[2] = "warning"; + m_levels[2] = "WARNING"; m_speech[2] = &Harl::warning; - m_levels[3] = "error"; + m_levels[3] = "ERROR"; m_speech[3] = &Harl::error; } @@ -48,29 +48,29 @@ void Harl::complain(std::string level) if (selected) (this->*selected)(); else - std::cout << "Harl does not know this level.\n"; + std::cout << "Harl does not know this level.\n\n"; } void Harl::debug(void) { std::cout << "I love having extra bacon for my " - "7XL-double-cheese-triple-pickle-special-ketchup burger. I really do!\n"; + "7XL-double-cheese-triple-pickle-special-ketchup burger. I really do!\n\n"; } void Harl::info(void) { std::cout << "I cannot believe adding extra bacon costs more money. " "You didn’t put enough bacon in my burger! " - "If you did, I wouldn’t be asking for more!\n"; + "If you did, I wouldn’t be asking for more!\n\n"; } void Harl::warning(void) { std::cout << "I think I deserve to have some extra bacon for free. " - "I’ve been coming for ears whereas you started working here since last month.\n"; + "I’ve been coming for ears whereas you started working here since last month.\n\n"; } void Harl::error(void) { - std::cout << "This is unacceptable! I want to speak to the manager now.\n"; + std::cout << "This is unacceptable! I want to speak to the manager now.\n\n"; } diff --git a/ex05/main.cpp b/ex05/main.cpp index 7c58bf5..5d7dcf4 100644 --- a/ex05/main.cpp +++ b/ex05/main.cpp @@ -4,12 +4,12 @@ int main(void) { Harl harl; - harl.complain("info"); - harl.complain("debug"); - harl.complain("warning"); - harl.complain("error"); - harl.complain("debug"); - harl.complain("info"); - harl.complain("error"); + harl.complain("INFO"); + harl.complain("DEBUG"); + harl.complain("WARNING"); + harl.complain("ERROR"); + harl.complain("DEBUG"); + harl.complain("INFO"); + harl.complain("ERROR"); return (0); }