CPP00
1.0
読み取り中…
検索中…
一致する文字列を見つけられません
Contact.cpp
[詳解]
1
/* ************************************************************************** */
2
/* */
3
/* ::: :::::::: */
4
/* Contact.cpp :+: :+: :+: */
5
/* +:+ +:+ +:+ */
6
/* By: kamitsui <kamitsui@student.42tokyo.jp> +#+ +:+ +#+ */
7
/* +#+#+#+#+#+ +#+ */
8
/* Created: 2025/03/31 13:34:57 by kamitsui #+# #+# */
9
/* Updated: 2025/04/06 06:00:03 by kamitsui ### ########.fr */
10
/* */
11
/* ************************************************************************** */
12
21
#include "
Contact.hpp
"
22
28
Contact::Contact
() : firstName(
""
), lastName(
""
), nickName(
""
), phoneNumber(
""
), darkestSecret(
""
) {}
29
35
void
Contact::setFirstName
(
const
std::string
&firstName) { this->firstName = firstName; }
36
42
void
Contact::setLastName
(
const
std::string
&lastName) { this->lastName = lastName; }
43
49
void
Contact::setNickName
(
const
std::string
&nickName) { this->nickName = nickName; }
50
56
void
Contact::setPhoneNumber
(
const
std::string
&phoneNumber) { this->phoneNumber = phoneNumber; }
57
63
void
Contact::setDarkestSecret
(
const
std::string
&darkestSecret) { this->darkestSecret = darkestSecret; }
64
70
std::string
Contact::getFirstName
()
const
{
return
firstName; }
71
77
std::string
Contact::getLastName
()
const
{
return
lastName; }
78
84
std::string
Contact::getNickName
()
const
{
return
nickName; }
85
91
std::string
Contact::getPhoneNumber
()
const
{
return
phoneNumber; }
92
98
std::string
Contact::getDarkestSecret
()
const
{
return
darkestSecret; }
99
105
bool
Contact::isEmpty
()
const
{
106
return
firstName.
empty
() && lastName.
empty
() && nickName.
empty
() && phoneNumber.
empty
() && darkestSecret.
empty
();
107
}
Contact.hpp
Contact Class
std::basic_string
std::basic_string::empty
bool empty() const noexcept
Contact::isEmpty
bool isEmpty() const
Check if an object (contact) has empty member variable.
Definition
Contact.cpp:105
Contact::getLastName
std::string getLastName() const
Gets the last name
Definition
Contact.cpp:77
Contact::setFirstName
void setFirstName(const std::string &firstName)
Sets first name of contact.
Definition
Contact.cpp:35
Contact::getDarkestSecret
std::string getDarkestSecret() const
Gets the darkest secret of contact.
Definition
Contact.cpp:98
Contact::setNickName
void setNickName(const std::string &nickName)
Sets the nick name of contact.
Definition
Contact.cpp:49
Contact::getPhoneNumber
std::string getPhoneNumber() const
Gets the phone number of contact.
Definition
Contact.cpp:91
Contact::setDarkestSecret
void setDarkestSecret(const std::string &darkestSecret)
Sets the darkest secret of contact.
Definition
Contact.cpp:63
Contact::setPhoneNumber
void setPhoneNumber(const std::string &phoneNumber)
Sets the phone number of contact.
Definition
Contact.cpp:56
Contact::getFirstName
std::string getFirstName() const
Gets the first name of contact.
Definition
Contact.cpp:70
Contact::Contact
Contact()
Default constractor for the Contact class.
Definition
Contact.cpp:28
Contact::setLastName
void setLastName(const std::string &lastName)
Sets last name of contact.
Definition
Contact.cpp:42
Contact::getNickName
std::string getNickName() const
Gets the nick name of contact.
Definition
Contact.cpp:84
ex01
Contact.cpp
構築:
1.9.8