diff options
| author | Charles Cabergs <me@cacharle.xyz> | 2020-11-17 13:52:48 +0100 |
|---|---|---|
| committer | Charles Cabergs <me@cacharle.xyz> | 2020-11-17 13:52:48 +0100 |
| commit | 331c3596660fed6c8b04fdfd0a89435ccffaaf20 (patch) | |
| tree | 4196c94d9084a3d0ed45f3ec798d713639cbfc8a /cpp05/ex01/Bureaucrat.hpp | |
| parent | 4eecb32ffcf48c42672782fbcd53781a22e95ebf (diff) | |
| download | piscine_cpp-331c3596660fed6c8b04fdfd0a89435ccffaaf20.tar.gz piscine_cpp-331c3596660fed6c8b04fdfd0a89435ccffaaf20.tar.bz2 piscine_cpp-331c3596660fed6c8b04fdfd0a89435ccffaaf20.zip | |
Fixing cpp05/ex00-02
Diffstat (limited to 'cpp05/ex01/Bureaucrat.hpp')
| -rw-r--r-- | cpp05/ex01/Bureaucrat.hpp | 24 |
1 files changed, 15 insertions, 9 deletions
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 <charles.cabergs@gmail.com> +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* 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 <iostream> # include <exception> +# 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); |
