feat: finishing the form part
This commit is contained in:
parent
6790f1c03c
commit
5829da2bcb
7 changed files with 516 additions and 0 deletions
52
cpp05/ex01/Form.hpp
Normal file
52
cpp05/ex01/Form.hpp
Normal file
|
|
@ -0,0 +1,52 @@
|
|||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* ::: :::::::: */
|
||||
/* 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 ©);
|
||||
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
|
||||
Loading…
Add table
Add a link
Reference in a new issue