mirror of
https://github.com/Ladebeze66/cpp-partie-2.git
synced 2026-11-09 13:47:14 +01:00
ex06
This commit is contained in:
@@ -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/22 12:48:27 by fgras-ca ### ########.fr */
|
||||
/* Updated: 2024/02/26 15:57:56 by fgras-ca ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
@@ -19,23 +19,25 @@
|
||||
|
||||
class Bureaucrat;
|
||||
|
||||
class Form
|
||||
class AForm
|
||||
{
|
||||
private:
|
||||
const std::string name;
|
||||
const
|
||||
bool isSigned;
|
||||
const int gradeRequiredToSign;
|
||||
const int gradeRequiredToExecute;
|
||||
|
||||
public:
|
||||
//constructueur
|
||||
Form(const std::string &name, int gradeRequiredToSign, int gradeRequiredToExecute);
|
||||
AForm(const::std::string& name);
|
||||
AForm(const std::string &name, int gradeRequiredToSign, int gradeRequiredToExecute);
|
||||
// Constructeur par copie
|
||||
Form(const Form& other);
|
||||
AForm(const AForm& other);
|
||||
// Opérateur d'affectation
|
||||
Form& operator=(const Form& other);
|
||||
AForm& operator=(const AForm& other);
|
||||
// Destructeur
|
||||
~Form();
|
||||
~AForm();
|
||||
|
||||
|
||||
std::string getName() const;
|
||||
@@ -48,17 +50,23 @@ public:
|
||||
class GradeTooHighException : public std::exception
|
||||
{
|
||||
public:
|
||||
const char* what() const throw();
|
||||
const char* what() const noexcept override
|
||||
{
|
||||
return ("Grade too high");
|
||||
}
|
||||
};
|
||||
|
||||
class GradeTooLowException : public std::exception
|
||||
{
|
||||
public:
|
||||
const char* what() const throw();
|
||||
const char* what() const noexcept override
|
||||
{
|
||||
return ("Grade too low");
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
// Surcharge de l'opérateur d'insertion
|
||||
std::ostream& operator<<(std::ostream& os, const Form& form);
|
||||
std::ostream& operator<<(std::ostream& os, const AForm& form);
|
||||
|
||||
#endif
|
||||
|
||||
@@ -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/22 12:41:21 by fgras-ca ### ########.fr #
|
||||
# Updated: 2024/02/26 14:35:12 by fgras-ca ### ########.fr #
|
||||
# #
|
||||
# **************************************************************************** #
|
||||
|
||||
|
||||
Reference in New Issue
Block a user