-
Notifications
You must be signed in to change notification settings - Fork 14
/
Copy pathPessoa.cpp
55 lines (40 loc) · 1.29 KB
/
Pessoa.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
#include "Pessoa.h"
Pessoa::Pessoa( )
:phoneNumber(""), name("")
{
}
Pessoa::Pessoa( const string &name, const string& phoneNumber, const vector< string > &socialMediaConection )
{
this->name = name;
this->phoneNumber = phoneNumber;
this->socialMediaConection.resize( socialMediaConection.size() );
for( int i = 0; i < this->socialMediaConection.size( ); i++ )
this->socialMediaConection[ i ] = socialMediaConection[ i ];
//printSocialConnection( );
}
Pessoa::Pessoa( const Pessoa &pessoaOut )
{
this->name = pessoaOut.name;
this->phoneNumber = pessoaOut.phoneNumber;
this->socialMediaConection.resize( pessoaOut.socialMediaConection.size() );
for( int i = 0; i < this->socialMediaConection.size( ); i++ )
this->socialMediaConection[ i ] = pessoaOut.socialMediaConection[ i ];
}
Pessoa::~Pessoa( )
{
}
void Pessoa::printSocialConnection( ) const
{
cout << "List of social media sites:\n";
for( int i = 0; i < this->socialMediaConection.size( ); i++ )
cout << this->socialMediaConection[ i ] << '\n';
}
ostream &operator<<( ostream &out, const Pessoa &p )
{
out << "Name: ";
out << p.name << "\n";
out << "Phone number: ";
out << p.phoneNumber << "\n";
p.printSocialConnection( );
return out;
}