CPP05/ex01/inc/Form.hpp
whaffman bf2416c5c7 Add Bureaucrat and Form classes with color-coded output
- Implemented Bureaucrat class with constructors, destructors, and operator overloads.
- Added Form class with constructors, destructors, and methods for signing.
- Introduced color definitions in colors.h for enhanced console output.
- Integrated color-coded messages in Bureaucrat and Form methods for better visibility.
- Developed main function to demonstrate functionality and exception handling for Bureaucrat and Form.
2025-06-24 13:36:11 +02:00

48 lines
1.0 KiB
C++

#pragma once
#include <exception>
#include <string>
#include <iostream>
#include "Bureaucrat.hpp"
class Form
{
private:
const std::string _name;
bool _isSigned;
const int _signGrade;
const int _executeGrade;
public:
Form() = delete;
Form(std::string name, int signGrade, int executeGrade);
Form(const Form &other);
~Form();
Form &operator=(const Form &other) = delete;
const std::string &getName() const;
bool getIsSigned() const;
int getSignGrade() const;
int getExecuteGrade() const;
void beSigned(const Bureaucrat &bureaucrat);
class GradeTooHighException : public std::exception
{
public:
const char *what() const throw();
};
class GradeTooLowException : public std::exception
{
public:
const char *what() const throw();
};
class FormAlreadySignedException : public std::exception
{
public:
const char *what() const throw();
};
};
std::ostream &operator<<(std::ostream &os, const Form &form);