You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

52 lines
1.9 KiB

/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* Form.hpp :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: narnaud <narnaud@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2022/06/26 15:47:12 by narnaud #+# #+# */
/* Updated: 2022/06/27 01:05:27 by narnaud ### ########.fr */
/* */
/* ************************************************************************** */
#pragma once
#include "Bureaucrat.hpp"
#include <string>
#include <iostream>
#include <stdexcept>
using std::cout;
using std::endl;
using std::string;
class Form {
const string _name;
const int _signGrade;
const int _exeGrade;
bool _isSigned;
public:
class GradeTooHighException: virtual public std::exception {
public:
const char *what(void) const throw ();
}
class GradeTooLowException: virtual public std::exception {
public:
const char *what(void) const throw ();
}
Form(void);
Form(const string name, const int signGrade,const int exeGrade)
throw (GradeTooHighException, GradeTooLowException);
Form & operator=(Form const &f);
Form(Form const &f);
~Form();
const string getName(void) const;
const int getSignGrade(void) const;
const int getExeGrade(void) const;
beSigned(Bureaucrat);
}
std::ostream &operator<< (std::ostream &out, const Form &f) {
out << "Form: " << f.getName() << " - Required grade to sign: " << f.getSignGrade() << " - Required grade to execute: " << f.getExeGrade();
return (out);
}