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