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