From 1adb025a096c42696ca307ec7f8a9da0199ef914 Mon Sep 17 00:00:00 2001 From: kinou-p Date: Tue, 21 Jun 2022 23:53:56 +0200 Subject: [PATCH] end 01 06 --- cpp01/ex06/Makefile | 4 ++-- cpp01/ex06/main.cpp | 27 +++++++++++++++++++++++++-- 2 files changed, 27 insertions(+), 4 deletions(-) diff --git a/cpp01/ex06/Makefile b/cpp01/ex06/Makefile index 548f7b3..275de67 100644 --- a/cpp01/ex06/Makefile +++ b/cpp01/ex06/Makefile @@ -6,13 +6,13 @@ # By: apommier +#+ +:+ +#+ # # +#+#+#+#+#+ +#+ # # Created: 2022/06/21 23:38:45 by apommier #+# #+# # -# Updated: 2022/06/21 23:40:23 by apommier ### ########.fr # +# Updated: 2022/06/21 23:46:38 by apommier ### ########.fr # # # # **************************************************************************** # NAME = harlFilter SRCS = main.cpp\ - + Harl.cpp OBJS = ${SRCS:.cpp=.o} CC = c++ diff --git a/cpp01/ex06/main.cpp b/cpp01/ex06/main.cpp index cb1a1af..e124d8a 100644 --- a/cpp01/ex06/main.cpp +++ b/cpp01/ex06/main.cpp @@ -6,8 +6,31 @@ /* By: apommier +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2022/06/21 23:40:41 by apommier #+# #+# */ -/* Updated: 2022/06/21 23:40:55 by apommier ### ########.fr */ +/* Updated: 2022/06/21 23:52:51 by apommier ### ########.fr */ /* */ /* ************************************************************************** */ -#include "Harl.hpp" \ No newline at end of file +#include "Harl.hpp" + +int main(int ac, char **av) +{ + Harl harl; + bool freeHarl = 0; + std::string levelTab[4] = {"DEBUG", "INFO", "WARNING", "ERROR"}; + + if (ac != 2) + return (0); + for (int j = 0; j < 4; j++) + { + if (av[1] == levelTab[j]) + freeHarl = 1; + if (freeHarl == 1) + { + while (j < 4) + { + harl.complain(levelTab[j]); + j++; + } + } + } +} \ No newline at end of file