d05 ex01 form ok

This commit is contained in:
Hugo LAMY
2022-02-28 17:56:20 +01:00
parent ce1bde6d2c
commit 4946eb3b8c
11 changed files with 452 additions and 11 deletions

Binary file not shown.

View File

@@ -15,15 +15,6 @@ public:
~Bureaucrat();
Bureaucrat & operator=( Bureaucrat const & rhs );
class GradeTooHighException : public std::exception {
public:
const char * what() const throw();
};
class GradeTooLowException : public std::exception {
public:
const char * what() const throw();
};
std::string getName() const;
int getGrade() const;
@@ -38,6 +29,11 @@ protected:
private:
Bureaucrat();
class GradeTooHighException : public std::exception {
const char * what() const throw();};
class GradeTooLowException : public std::exception {
const char * what() const throw();};
};
std::ostream & operator<<(std::ostream & o, Bureaucrat const & rhs);

View File

@@ -80,8 +80,8 @@ void Bureaucrat::gradeDown() {
*********************************************/
const char * Bureaucrat::GradeTooHighException::what() const throw() {
return ("grade higher than 1");
return (B_RED "grade higher than 1" RESET);
}
const char * Bureaucrat::GradeTooLowException::what() const throw() {
return ("grade lower than 150");
return (B_RED "grade lower than 150" RESET);
}