Change recognized levels to upper case in ex05
authorLukas Jiriste <ljiriste@student.42prague.com>
Fri, 11 Oct 2024 11:19:33 +0000 (13:19 +0200)
committerLukas Jiriste <ljiriste@student.42prague.com>
Fri, 11 Oct 2024 11:33:26 +0000 (13:33 +0200)
ex05/Harl.cpp
ex05/main.cpp

index b060fd945f75377ef19214bdd13470bcd03c13a7..2f89f80622fdb79a39ae5027a4af649203d308b5 100644 (file)
@@ -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";
 }
index 7c58bf54a121236e507f73bbfa47711cf194feb0..5d7dcf4ea4cf19dbeb3bda5ac3df260052c6ba60 100644 (file)
@@ -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);
 }