diff --git a/cpp01/ex06/Harl.cpp b/cpp01/ex06/Harl.cpp index 4341af2..fbab426 100644 --- a/cpp01/ex06/Harl.cpp +++ b/cpp01/ex06/Harl.cpp @@ -6,7 +6,7 @@ /* By: apommier +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2022/06/21 23:39:20 by apommier #+# #+# */ -/* Updated: 2022/07/22 09:40:02 by apommier ### ########.fr */ +/* Updated: 2022/07/22 09:52:45 by apommier ### ########.fr */ /* */ /* ************************************************************************** */ @@ -34,16 +34,17 @@ void Harl::complain(std::string level) } } -int Harl::ChooseComplain(std::string level) +int Harl::chooseComplain(std::string level) { - void (Harl::*complaint[])(void) = {&Harl::debug, &Harl::info, &Harl::warning, &Harl::error}; + //void (Harl::*complaint[])(void) = {&Harl::debug, &Harl::info, &Harl::warning, &Harl::error}; std::string levelTab[4] = {"DEBUG", "INFO", "WARNING", "ERROR"}; for (int i = 0; i < 4 ; i++) { - void (Harl::*selectedComplaint)( void ) = complaint[i]; + //void (Harl::*selectedComplaint)( void ) = complaint[i]; if (level == levelTab[i]) return (i); } + return (4); } diff --git a/cpp01/ex06/main.cpp b/cpp01/ex06/main.cpp index f56d030..e6b0d24 100644 --- a/cpp01/ex06/main.cpp +++ b/cpp01/ex06/main.cpp @@ -6,7 +6,7 @@ /* By: apommier +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2022/06/21 23:40:41 by apommier #+# #+# */ -/* Updated: 2022/07/22 09:44:33 by apommier ### ########.fr */ +/* Updated: 2022/07/22 09:54:21 by apommier ### ########.fr */ /* */ /* ************************************************************************** */ @@ -24,15 +24,20 @@ void harFilter(Harl harl, std::string level) harl.complain("INFO"); harl.complain("WARNING"); harl.complain("ERROR"); + break; case 2 : harl.complain("INFO"); harl.complain("WARNING"); - harl.complain("ERROR"); + harl.complain("ERROR"); + break; case 3 : harl.complain("WARNING"); harl.complain("ERROR"); + break; + case 4 : harl.complain("ERROR"); + break; default : std::cout << "[ Probably complaining about insignificant problems ]\n"; } @@ -42,7 +47,7 @@ int main(int ac, char **av) { Harl harl; - std::cout << ac << std::endl; + //std::cout << ac << std::endl; if (ac != 2) { std::cerr << "Bad entry\n";