piscine_cpp/cpp05/ex01/Form.hpp
2025-03-17 20:18:31 +01:00

52 lines
1.8 KiB
C++

/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* Form.hpp :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: rparodi <rparodi@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2025/03/17 14:20:06 by rparodi #+# #+# */
/* Updated: 2025/03/17 20:17:37 by rparodi ### ########.fr */
/* */
/* ************************************************************************** */
#ifndef FORM_HPP
#define FORM_HPP
#include <string>
#include <iostream>
class Bureaucrat;
class Form {
public:
Form();
Form(std::string const name, int execute, int sign);
Form(Form const &copy);
Form& operator=(Form const &assign);
~Form();
class GradeTooHighException : public std::exception {
virtual const char *what() const throw() {
return ("Error:\n> Grade is too high (have to be lower than 1)");
}
};
class GradeTooLowException : public std::exception {
virtual const char *what() const throw() {
return ("Error:\n> Grade is too low (have to be higher than 150)");
}
};
std::string getName() const;
void beSigned(Bureaucrat &bureaucrat);
int getExecute() const;
int getSign() const;
bool isSigned() const;
private:
std::string _name;
bool _signed;
int _to_execute;
int _to_sign;
};
std::ostream& operator<<(std::ostream& output, Form const &Form);
#endif