From 7ac812044bfe771178752a52d70b18bb297c1891 Mon Sep 17 00:00:00 2001 From: Charles Date: Tue, 14 Apr 2020 20:42:26 +0200 Subject: cpp07 done, cpp06 ex00 and ex01 start --- cpp05/ex01/Form.hpp | 63 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 63 insertions(+) create mode 100644 cpp05/ex01/Form.hpp (limited to 'cpp05/ex01/Form.hpp') diff --git a/cpp05/ex01/Form.hpp b/cpp05/ex01/Form.hpp new file mode 100644 index 0000000..a2421bd --- /dev/null +++ b/cpp05/ex01/Form.hpp @@ -0,0 +1,63 @@ +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* Form.hpp :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: charles +#+ +:+ +#+ */ +/* +#+#+#+#+#+ +#+ */ +/* Created: 2020/04/14 19:19:45 by charles #+# #+# */ +/* Updated: 2020/04/14 19:37:21 by charles ### ########.fr */ +/* */ +/* ************************************************************************** */ + +#ifndef FORM_HPP +# define FORM_HPP + +# include "Bureaucrat.hpp" + +class Form +{ +public: + Form(Form const& other); + void operator=(Form const& other); + ~Form(); + + Form(std::string const& name); + std::string const& getName() const; + bool getSigned() const; + int getGradeSign() const; + int getGradeExecute() const; + void beSigned(Bureaucrat const& b); + + class GradeTooHighException : public std::exception + { + public: + GradeTooHighException(); + GradeTooHighException(GradeTooHighException const& other); + void operator=(GradeTooHighException const& other); + ~GradeTooHighException(); + virtual char const* what() const throw(); + }; + + class GradeTooLowException : public std::exception + { + public: + GradeTooLowException(); + GradeTooLowException(GradeTooLowException const& other); + void operator=(GradeTooLowException const& other); + ~GradeTooLowException(); + virtual char const* what() const throw(); + }; + +private: + Form(); + + std::string const m_name; + bool m_signed; + int const m_gradeSign; + int const m_gradeExecute; +}; + +std::ostream& operator<<(std::ostream& out, Form const& f); + +#endif -- cgit