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/ex00/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/ex00/Bureaucrat.hpp')
| -rw-r--r-- | cpp05/ex00/Bureaucrat.hpp | 27 |
1 files changed, 15 insertions, 12 deletions
diff --git a/cpp05/ex00/Bureaucrat.hpp b/cpp05/ex00/Bureaucrat.hpp index 7734725..222d219 100644 --- a/cpp05/ex00/Bureaucrat.hpp +++ b/cpp05/ex00/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:26:06 by cacharle ### ########.fr */ +/* Updated: 2020/11/17 10:28:41 by cacharle ### ########.fr */ /* */ /* ************************************************************************** */ @@ -24,10 +24,18 @@ public: ~Bureaucrat(); Bureaucrat(std::string const& name, int grade); - std::string const& getName() const; - int getGrade() const; - void incrementGrade(); - void decrementGrade(); + + std::string const& getName() const; + int getGrade() const; + void incrementGrade(); + void decrementGrade(); + +private: + Bureaucrat(); + void checkGrade(); + + std::string m_name; + int m_grade; class GradeTooHighException : public std::exception { @@ -35,7 +43,7 @@ public: GradeTooHighException(); GradeTooHighException(GradeTooHighException const& other); GradeTooHighException& operator=(GradeTooHighException const& other); - ~GradeTooHighException(); + ~GradeTooHighException() throw(); virtual char const* what() const throw(); }; @@ -45,15 +53,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); |
