From 331c3596660fed6c8b04fdfd0a89435ccffaaf20 Mon Sep 17 00:00:00 2001 From: Charles Cabergs Date: Tue, 17 Nov 2020 13:52:48 +0100 Subject: Fixing cpp05/ex00-02 --- cpp05/ex01/Bureaucrat.hpp | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) (limited to 'cpp05/ex01/Bureaucrat.hpp') diff --git a/cpp05/ex01/Bureaucrat.hpp b/cpp05/ex01/Bureaucrat.hpp index aabf557..1886a76 100644 --- a/cpp05/ex01/Bureaucrat.hpp +++ b/cpp05/ex01/Bureaucrat.hpp @@ -6,7 +6,7 @@ /* By: charles +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2020/04/14 18:04:32 by charles #+# #+# */ -/* Updated: 2020/10/19 13:23:52 by cacharle ### ########.fr */ +/* Updated: 2020/11/17 11:32:12 by cacharle ### ########.fr */ /* */ /* ************************************************************************** */ @@ -15,6 +15,9 @@ # include # include +# include "Form.hpp" + +class Form; class Bureaucrat { @@ -25,19 +28,27 @@ public: Bureaucrat(std::string const& name, int grade); - std::string const& getName() const; + std::string const& getName() const; int getGrade() const; void incrementGrade(); void decrementGrade(); + void signForm(Form& form); +private: + Bureaucrat(); + void checkGrade(); + + std::string m_name; + int m_grade; + class GradeTooHighException : public std::exception { public: GradeTooHighException(); GradeTooHighException(GradeTooHighException const& other); GradeTooHighException& operator=(GradeTooHighException const& other); - ~GradeTooHighException(); + ~GradeTooHighException() throw(); virtual char const* what() const throw(); }; @@ -47,15 +58,10 @@ public: GradeTooLowException(); GradeTooLowException(GradeTooLowException const& other); GradeTooLowException& operator=(GradeTooLowException const& other); - ~GradeTooLowException(); + ~GradeTooLowException() throw(); virtual char const* what() const throw(); }; -private: - Bureaucrat(); - - std::string const m_name; - int m_grade; }; std::ostream& operator<<(std::ostream& out, Bureaucrat const& b); -- cgit