1
0
This repository has been archived on 2025-01-26. You can view files and clone it, but cannot push or open issues or pull requests.
CPP_Module_04/ex02/WrongAnimal.cpp

47 lines
1.7 KiB
C++
Raw Normal View History

2024-12-06 16:24:15 +01:00
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* WrongAnimal.cpp :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: adjoly <adjoly@student.42angouleme.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/12/01 19:14:27 by adjoly #+# #+# */
/* Updated: 2024/12/04 13:56:34 by adjoly ### ########.fr */
/* */
/* ************************************************************************** */
#include "WrongAnimal.hpp"
WrongAnimal::WrongAnimal(void) {
log("", "WrongAnimal", "", "construtor called");
}
WrongAnimal::~WrongAnimal() {
log("", "WrongAnimal", _type, "destructor called");
}
WrongAnimal::WrongAnimal(std::string type) : _type(type) {
log("", "WrongAnimal", type, "construtor called");
}
WrongAnimal::WrongAnimal(const WrongAnimal &cpy) {
log("", "WrongAnimal", _type, "copy construtor called");
*this = cpy;
}
WrongAnimal &WrongAnimal::operator=(const WrongAnimal &cpy) {
log("🟰", "WrongAnimal", _type, "copy assignment construtor called");
if (this != &cpy) {
_type = cpy._type;
}
return (*this);
}
void WrongAnimal::makeSound(void) const {
log("🔊", "WrongAnimal", "", "making a wrong sound OOOOOOOOOOOOOOOoo");
}
std::string WrongAnimal::getType(void) const {
return (_type);
}