diff --git a/ex05/Harl/Harl.cpp b/ex05/Harl/Harl.cpp index 7c1e681..ac28285 100644 --- a/ex05/Harl/Harl.cpp +++ b/ex05/Harl/Harl.cpp @@ -14,24 +14,28 @@ void Harl::debug( void ) { + std::cout << "[ DEBUG ]" << std::endl; std::cout << "I love having extra bacon for my 7XL-double-cheese-triple-pickle-specialketchup burger. I really do!"; std::cout << std::endl; } void Harl::info( void ) { + std::cout << "[ INFO ]" << std::endl; 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!"; std::cout << std::endl; } void Harl::warning( void ) { + std::cout << "[ WARNING ]" << std::endl; std::cout << "I think I deserve to have some extra bacon for free. I’ve been coming for years, whereas you started working here just last month."; std::cout << std::endl; } void Harl::error( void ) { + std::cout << "[ ERROR ]" << std::endl; std::cout << "This is unacceptable! I want to speak to the manager now."; std::cout << std::endl; } @@ -50,6 +54,7 @@ void Harl::complain( std::string level ) if (level == levels[i]) { (this->*funcs[i])(); + std::cout << std::endl; break ; } i++; diff --git a/ex06/Harl/Harl.cpp b/ex06/Harl/Harl.cpp new file mode 100644 index 0000000..6944290 --- /dev/null +++ b/ex06/Harl/Harl.cpp @@ -0,0 +1,77 @@ +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* Harl.hpp :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: aortigos *funcs[i++])(); + /* fall through */ + case 1: + (this->*funcs[i++])(); + /* fall through */ + case 2: + (this->*funcs[i++])(); + /* fall through */ + case 3: + (this->*funcs[i])(); + /* fall through */ + break; + default: + std::cout << "[ Probably complaining about insignificant problems ]" << std::endl;; + break; + } +} \ No newline at end of file diff --git a/ex06/Harl/Harl.hpp b/ex06/Harl/Harl.hpp new file mode 100644 index 0000000..4d0fe41 --- /dev/null +++ b/ex06/Harl/Harl.hpp @@ -0,0 +1,32 @@ +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* Harl.hpp :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: aortigos + +class Harl +{ + private: + void debug( void ); + void info( void ); + void warning( void ); + void error( void ); + + public: + void complain( std::string level ); + +}; + +#endif diff --git a/ex06/Makefile b/ex06/Makefile new file mode 100644 index 0000000..d922f5f --- /dev/null +++ b/ex06/Makefile @@ -0,0 +1,26 @@ +NAME=harlFilter + +SRCS=main.cpp Harl/Harl.cpp + +OBJS=$(SRCS:.cpp=.o) + +CC=g++ +CFLAGS=-Wall -Wextra -Werror -std=c++98 + +all: $(NAME) + +$(NAME): $(OBJS) + $(CC) $(CFLAGS) $(OBJS) -o $(NAME) + +%.o: %.cpp + $(CC) $(CFLAGS) -c $< -o $@ + +clean: + rm -f $(OBJS) + +fclean: clean + rm -f $(NAME) + +re: fclean all + +.PHONY: all clean fclean re diff --git a/ex06/main.cpp b/ex06/main.cpp new file mode 100644 index 0000000..40433d5 --- /dev/null +++ b/ex06/main.cpp @@ -0,0 +1,24 @@ +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* main.cpp :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: aortigos