ShrubberyCreationForm.hpp
1 /* ************************************************************************** */ 2 /* */ 3 /* ::: :::::::: */ 4 /* ShrubberyCreationForm.hpp :+: :+: :+: */ 5 /* +:+ +:+ +:+ */ 6 /* By: gychoi <gychoi@student.42seoul.kr> +#+ +:+ +#+ */ 7 /* +#+#+#+#+#+ +#+ */ 8 /* Created: 2023/11/28 22:10:06 by gychoi #+# #+# */ 9 /* Updated: 2023/12/11 18:29:27 by gychoi ### ########.fr */ 10 /* */ 11 /* ************************************************************************** */ 12 13 #pragma once 14 #ifndef __SHRUBBERYCREATIONFORM_HPP__ 15 #define __SHRUBBERYCREATIONFORM_HPP__ 16 17 #include <cstdlib> 18 #include <ctime> 19 #include <fstream> 20 21 #include "AForm.hpp" 22 23 /* ************************************************************************** */ 24 /* ShrubberyCreationForm */ 25 /* ************************************************************************** */ 26 class ShrubberyCreationForm : public AForm 27 { 28 public: 29 ShrubberyCreationForm(); 30 ShrubberyCreationForm(std::string const& targetsName); 31 ShrubberyCreationForm(ShrubberyCreationForm const& target); 32 ShrubberyCreationForm& operator=(ShrubberyCreationForm const& target); 33 virtual ~ShrubberyCreationForm(); 34 35 public: 36 virtual void beSigned(Bureaucrat const& bureaucrat); 37 virtual void execute(Bureaucrat const& executor) const; 38 39 /* ************************************************************************** */ 40 /* ShrubberyCreationForm::GradeTooHighException */ 41 /* ************************************************************************** */ 42 public: 43 class GradeTooHighException : public AForm::GradeTooHighException 44 { 45 public: 46 GradeTooHighException(); 47 GradeTooHighException(std::string const& msg); 48 GradeTooHighException(GradeTooHighException const& target); 49 GradeTooHighException& operator=(GradeTooHighException const& target); 50 virtual ~GradeTooHighException() throw(); 51 52 public: 53 std::string const& getMessage() const; 54 55 public: 56 virtual char const* what() const throw(); 57 58 private: 59 std::string mMessage; 60 }; 61 62 /* ************************************************************************** */ 63 /* ShrubberyCreationForm::GradeTooLowException */ 64 /* ************************************************************************** */ 65 public: 66 class GradeTooLowException : public AForm::GradeTooLowException 67 { 68 public: 69 GradeTooLowException(); 70 GradeTooLowException(std::string const& msg); 71 GradeTooLowException(GradeTooLowException const& target); 72 GradeTooLowException& operator=(GradeTooLowException const& target); 73 virtual ~GradeTooLowException() throw(); 74 75 public: 76 std::string const& getMessage() const; 77 78 public: 79 virtual char const* what() const throw(); 80 81 private: 82 std::string mMessage; 83 }; 84 85 /* ************************************************************************** */ 86 /* ShrubberyCreationForm::FormNotSignedException */ 87 /* ************************************************************************** */ 88 public: 89 class FormNotSignedException : public std::exception 90 { 91 public: 92 FormNotSignedException(); 93 FormNotSignedException(std::string const& msg); 94 FormNotSignedException(FormNotSignedException const& target); 95 FormNotSignedException& operator=(FormNotSignedException const& target); 96 virtual ~FormNotSignedException() throw(); 97 98 public: 99 std::string const& getMessage() const; 100 101 public: 102 virtual char const* what() const throw(); 103 104 private: 105 std::string mMessage; 106 }; 107 }; 108 109 std::ostream& operator<<(std::ostream& os, 110 ShrubberyCreationForm const& target); 111 112 #endif /* __SHRUBBERYCREATIONFORM_HPP__ */