| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465 |
- /* ************************************************************************** */
- /* */
- /* ::: :::::::: */
- /* Form.hpp :+: :+: :+: */
- /* +:+ +:+ +:+ */
- /* By: bchanot <bchanot@42.fr> +#+ +:+ +#+ */
- /* +#+#+#+#+#+ +#+ */
- /* Created: 2025/12/29 16:42:01 by bchanot #+# #+# */
- /* Updated: 2025/12/30 14:00:46 by bchanot ### ########.fr */
- /* */
- /* ************************************************************************** */
- #ifndef FORM_HPP
- # define FORM_HPP
- # include <iostream>
- # include <string>
- # include <cstdint>
- class Bureaucrat;
- class Form
- {
- public:
- Form();
- Form( Form const & src );
- Form( std::string const name, uint8_t const signGrade, uint8_t const executeGrade );
- ~Form();
- Form & operator=( Form const & rhs );
-
- class GradeTooHighException : public std::exception {
- public:
- virtual const char *what() const throw() {
- return ("The grade specified is too high !");
- }
- };
-
- class GradeTooLowException : public std::exception {
- public:
- virtual const char *what() const throw() {
- return ("The grade specified is too low !");
- }
- };
- std::string const getName(void) const;
- uint8_t getSignGrade(void) const;
- uint8_t getExecutionGrade(void) const;
- bool getSigned(void) const;
- void beSigned(const Bureaucrat &sch);
- private:
- std::string const _name;
- uint8_t const _signGrade;
- uint8_t const _executeGrade;
- bool _signed;
- };
- std::ostream & operator<<( std::ostream & o, Form const & i );
- #endif /* ************************************************************ FORM_H */
|