mirror of
https://github.com/Ladebeze66/cpp-partie-2.git
synced 2026-11-09 13:47:14 +01:00
ex02
This commit is contained in:
@@ -6,7 +6,7 @@
|
||||
/* By: fgras-ca <fgras-ca@student.42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2024/02/11 12:57:28 by fgras-ca #+# #+# */
|
||||
/* Updated: 2024/02/16 17:30:30 by fgras-ca ### ########.fr */
|
||||
/* Updated: 2024/02/22 12:45:13 by fgras-ca ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
@@ -34,13 +34,13 @@ public:
|
||||
class GradeTooHighException : public std::exception
|
||||
{
|
||||
public:
|
||||
const char* what() const throw() override;
|
||||
const char* what() const throw();
|
||||
};
|
||||
|
||||
class GradeTooLowException : public std::exception
|
||||
{
|
||||
public:
|
||||
const char* what() const throw() override;
|
||||
const char* what() const throw();
|
||||
};
|
||||
|
||||
Bureaucrat();
|
||||
|
||||
@@ -6,19 +6,13 @@
|
||||
/* By: fgras-ca <fgras-ca@student.42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2024/02/11 14:39:51 by fgras-ca #+# #+# */
|
||||
/* Updated: 2024/02/16 18:19:00 by fgras-ca ### ########.fr */
|
||||
/* Updated: 2024/02/22 12:48:40 by fgras-ca ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
#include "Bureaucrat.hpp"
|
||||
#include "Form.hpp"
|
||||
|
||||
Form::Form()
|
||||
: name(name), isSigned(false), gradeRequiredToSign(1), gradeRequiredToExecute(1)
|
||||
{
|
||||
std::cout << GREEN << "Form default constructor called!" << RESET << std::endl;
|
||||
}
|
||||
|
||||
Form::Form(const std::string &name, int gradeRequiredToSign, int gradeRequiredToExecute)
|
||||
: name(name), isSigned(false), gradeRequiredToSign(gradeRequiredToSign), gradeRequiredToExecute(gradeRequiredToExecute)
|
||||
{
|
||||
@@ -84,12 +78,12 @@ void Form::beSigned(const Bureaucrat& bureaucrat)
|
||||
}
|
||||
}
|
||||
|
||||
const char* Form::GradeTooHighException::what() const noexcept
|
||||
const char* Form::GradeTooHighException::what() const throw()
|
||||
{
|
||||
return ("Grade too hight\n");
|
||||
}
|
||||
|
||||
const char* Form::GradeTooLowException::what() const noexcept
|
||||
const char* Form::GradeTooLowException::what() const throw()
|
||||
{
|
||||
return ("Grade too low\n");
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
/* By: fgras-ca <fgras-ca@student.42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2024/02/11 14:37:14 by fgras-ca #+# #+# */
|
||||
/* Updated: 2024/02/16 18:26:09 by fgras-ca ### ########.fr */
|
||||
/* Updated: 2024/02/22 12:48:27 by fgras-ca ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
@@ -29,7 +29,6 @@ private:
|
||||
|
||||
public:
|
||||
//constructueur
|
||||
Form();
|
||||
Form(const std::string &name, int gradeRequiredToSign, int gradeRequiredToExecute);
|
||||
// Constructeur par copie
|
||||
Form(const Form& other);
|
||||
@@ -49,13 +48,13 @@ public:
|
||||
class GradeTooHighException : public std::exception
|
||||
{
|
||||
public:
|
||||
const char* what() const noexcept override;
|
||||
const char* what() const throw();
|
||||
};
|
||||
|
||||
class GradeTooLowException : public std::exception
|
||||
{
|
||||
public:
|
||||
const char* what() const noexcept override;
|
||||
const char* what() const throw();
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
# By: fgras-ca <fgras-ca@student.42.fr> +#+ +:+ +#+ #
|
||||
# +#+#+#+#+#+ +#+ #
|
||||
# Created: 2023/12/27 20:57:42 by fgras-ca #+# #+# #
|
||||
# Updated: 2024/02/11 14:58:41 by fgras-ca ### ########.fr #
|
||||
# Updated: 2024/02/22 12:41:21 by fgras-ca ### ########.fr #
|
||||
# #
|
||||
# **************************************************************************** #
|
||||
|
||||
@@ -29,14 +29,16 @@ SRC = Bureaucrat.cpp \
|
||||
Form.cpp \
|
||||
main.cpp \
|
||||
|
||||
OBJS = ${SRC:.cpp=.o}
|
||||
|
||||
CC = c++
|
||||
CFLAGS = -Wall -Werror -Wextra -std=c++98
|
||||
RM = rm -f
|
||||
OBJS = ${SRC:.cpp=.o}
|
||||
|
||||
all : $(NAME)
|
||||
|
||||
%.o: %.cpp
|
||||
$(CC) $(CFLAGS) -c $< -o $@
|
||||
|
||||
$(NAME) : $(OBJS)
|
||||
@echo "$(RED)Compilation fixed... $(DEF_COLOR)"
|
||||
$(CC) $(CFLAGS) $(OBJS) -g -o $(NAME)
|
||||
|
||||
Reference in New Issue
Block a user