cpp/CPP00/ex01/Contact.cpp
2024-12-04 17:29:31 +01:00

51 lines
935 B
C++

#include "Contact.hpp"
Contact::Contact(void) {
this->init = false;
}
Contact::Contact(std::string fname, std::string lname, std::string nname, std::string phnbr, std::string drksct) {
this->init = true;
this->fname = fname;
this->lname = lname;
this->nname = nname;
this->phnbr = phnbr;
this->drksct = drksct;
}
Contact& Contact::operator=(const Contact& other) {
if (this != &other) {
this->init = true;
this->fname = other.fname;
this->lname = other.lname;
this->nname = other.nname;
this->phnbr = other.phnbr;
this->drksct = other.drksct;
}
return (*this);
}
std::string Contact::getFname(void) {
return (fname);
}
std::string Contact::getLname(void) {
return (lname);
}
std::string Contact::getNname(void) {
return (nname);
}
std::string Contact::getPhnbr(void) {
return (phnbr);
}
std::string Contact::getDrksct(void) {
return (drksct);
}
bool Contact::getInit(void) {
return (init);
}