From c426fe76ec5925e8c94aae3db04e5e1f1ce1585e Mon Sep 17 00:00:00 2001 From: Charles Cabergs Date: Mon, 19 Oct 2020 13:59:12 +0200 Subject: Adding boilerplate cpp05/ex02 --- cpp05/ex02/Bureaucrat.hpp | 63 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 63 insertions(+) create mode 100644 cpp05/ex02/Bureaucrat.hpp (limited to 'cpp05/ex02/Bureaucrat.hpp') diff --git a/cpp05/ex02/Bureaucrat.hpp b/cpp05/ex02/Bureaucrat.hpp new file mode 100644 index 0000000..aabf557 --- /dev/null +++ b/cpp05/ex02/Bureaucrat.hpp @@ -0,0 +1,63 @@ +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* Bureaucrat.hpp :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: charles +#+ +:+ +#+ */ +/* +#+#+#+#+#+ +#+ */ +/* Created: 2020/04/14 18:04:32 by charles #+# #+# */ +/* Updated: 2020/10/19 13:23:52 by cacharle ### ########.fr */ +/* */ +/* ************************************************************************** */ + +#ifndef BUREAUCRAT_HPP +# define BUREAUCRAT_HPP + +# include +# include + +class Bureaucrat +{ +public: + Bureaucrat(Bureaucrat const& other); + Bureaucrat& operator=(Bureaucrat const& other); + ~Bureaucrat(); + + Bureaucrat(std::string const& name, int grade); + + std::string const& getName() const; + int getGrade() const; + void incrementGrade(); + void decrementGrade(); + void signForm(Form& form); + + class GradeTooHighException : public std::exception + { + public: + GradeTooHighException(); + GradeTooHighException(GradeTooHighException const& other); + GradeTooHighException& operator=(GradeTooHighException const& other); + ~GradeTooHighException(); + virtual char const* what() const throw(); + }; + + class GradeTooLowException : public std::exception + { + public: + GradeTooLowException(); + GradeTooLowException(GradeTooLowException const& other); + GradeTooLowException& operator=(GradeTooLowException const& other); + ~GradeTooLowException(); + 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); + +#endif -- cgit