cpp/CPP05/ex00/Bureaucrat.hpp
2024-12-04 17:29:31 +01:00

40 lines
776 B
C++

#ifndef BUREAUCRAT_HPP
# define BUREAUCRAT_HPP
# include <exception>
# include <iostream>
class Bureaucrat {
public:
class GradeTooHighException : public std::exception {
public:
char const* what() const throw();
};
class GradeTooLowException : public std::exception {
public:
char const* what() const throw();
};
Bureaucrat();
Bureaucrat(std::string name, int grade);
~Bureaucrat();
Bureaucrat(const Bureaucrat &other);
Bureaucrat &operator=(const Bureaucrat &other);
std::string getName() const;
int getGrade() const;
void setName(std::string name);
void increaseGrade();
void decreaseGrade();
private:
const std::string name;
int grade;
};
std::ostream& operator<<(std::ostream& os, Bureaucrat const& crat);
#endif