Files
cpp05/ex00/Bureaucrat/Bureaucrat.hpp
2026-02-21 12:15:22 +01:00

53 lines
1.6 KiB
C++

/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* Bureaucrat.hpp :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: aortigos <aortigos@student.42malaga.com +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2026/02/21 11:37:35 by aortigos #+# #+# */
/* Updated: 2026/02/21 11:37:36 by aortigos ### ########.fr */
/* */
/* ************************************************************************** */
#ifndef BUREAUCRAT_HPP
# define BUREAUCRAT_HPP
# include <iostream>
class Bureaucrat
{
private:
const std::string name;
int grade;
public:
Bureaucrat();
Bureaucrat(const Bureaucrat &other);
Bureaucrat &operator=(const Bureaucrat &other);
~Bureaucrat();
Bureaucrat(std::string name, int grade);
std::string getName() const;
int getGrade() const;
void incrementGrade();
void decrementGrade();
class GradeTooHighException : public std::exception {
public:
virtual const char* what() const throw();
};
class GradeTooLowException : public std::exception {
public:
virtual const char* what() const throw();
};
};
std::ostream &operator<<(std::ostream &os, const Bureaucrat &bureaucrat);
#endif