1
0

」 feat: finished ex01 (normally)

This commit is contained in:
2025-03-30 16:18:58 +02:00
parent e5bf6c151c
commit 2b136d90f4
6 changed files with 27 additions and 24 deletions

View File

@ -6,14 +6,14 @@
/* By: adjoly <adjoly@student.42angouleme.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2025/03/09 17:38:19 by adjoly #+# #+# */
/* Updated: 2025/03/29 16:49:11 by adjoly ### ########.fr */
/* Updated: 2025/03/30 15:14:17 by adjoly ### ########.fr */
/* */
/* ************************************************************************** */
#include "Form.hpp"
#include "Bureaucrat.hpp"
Form::Form(void) : _name(""), _signed(false), _minForExec(1), _minForSign(1) {
Form::Form(void) : _name(""), _signed(false), _minForSign(1), _minForExec(1) {
_log("", "Form", "", "default constructor called");
}
Form::Form(std::string name, uint8_t minForSign, uint8_t minForExec)
@ -25,17 +25,17 @@ Form::Form(std::string name, uint8_t minForSign, uint8_t minForExec)
Form::~Form(void) { _log("", "Form", "", "destructor called"); }
const char *Form::GradeTooHighException::what() const throw() {
return ("Grade is too high");
return ("grade is too high");
}
const char *Form::GradeTooLowException::what() const throw() {
return ("Grade is too low");
return ("grade is too low");
}
const std::string Form::getName(void) const { return _name; }
bool Form::getSigned(void) { return _signed; }
const uint8_t Form::getMinForSign(void) { return _minForSign; }
const uint8_t Form::getMinForExec(void) { return _minForExec; }
std::string Form::getName(void) const { return _name; }
bool Form::getSigned(void) const { return _signed; }
uint8_t Form::getMinForSign(void) const { return _minForSign; }
uint8_t Form::getMinForExec(void) const { return _minForExec; }
void Form::beSigned(Bureaucrat b) {
if (_minForSign > b.getGrade()) {
@ -45,5 +45,6 @@ void Form::beSigned(Bureaucrat b) {
}
std::ostream &operator<<(std::ostream &os, Form &val) {
os << "Form: " << val.getName() << ", minGrade to sign: " <<
os << "Form: " << val.getName() << ", minGrade to sign: " << val.getMinForSign() << ", min grade to execute: " << val.getMinForExec() << std::endl;
return (os);
}