59void Harl::debug(
void) {
61 std::cout <<
"I love having extra bacon for my 7XL-double-cheese-triple-pickle-special-ketchup burger. I really do!"
68void Harl::info(
void) {
70 std::cout <<
"I cannot believe adding extra bacon costs more money. You didn't put enough bacon in my burger! If "
71 "you did, I wouldn't be asking for more!"
78void Harl::warning(
void) {
80 std::cout <<
"I think I deserve to have some extra bacon for free. I've been coming for years, whereas you started "
81 "working here just last month."
88void Harl::error(
void) {
102 static const std::string levels[] = {
"DEBUG",
"INFO",
"WARNING",
"ERROR"};
103 static ComplaintFunc functions[] = {&Harl::debug, &Harl::info, &Harl::warning, &Harl::error};
105 for (
int i = 0; i < 4; ++i) {
106 if (levels[i] == level) {
107 (this->*(functions[i]))();
Declares the Harl class, which can complain at different levels.
basic_ostream< _CharT, _Traits > & endl(basic_ostream< _CharT, _Traits > &__os)
Represents a Harl character who can complain at different levels.
~Harl()
Destructor for the Harl class.
Harl & operator=(const Harl &other)
Copy assignment operator for the Harl class.
Harl()
Default constructor for the Harl class.
void complain(std::string level)
Makes Harl complain based on the specified level.