-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTelEntry.cpp
48 lines (41 loc) · 846 Bytes
/
TelEntry.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
#include "TelEntry.h"
TelEntry::TelEntry(string &name, string &telNumber)
{
dt = new Date();
this->name = name;
this->telNumber = telNumber;
}
TelEntry::TelEntry(const vector<string> &list)
{
dt = new Date(list);
name = list[0];
telNumber = list[1];
}
TelEntry::~TelEntry()
{
delete dt;
}
EntryNode::EntryNode(string &name, string &telNumber): TelEntry(name, telNumber)
{
prev = nullptr;
next = nullptr;
}
EntryNode::EntryNode(const vector<string> &list): TelEntry(list)
{
prev = nullptr;
next = nullptr;
}
ostream& operator<<(ostream &out, const EntryNode *entry)
{
out << setw(30) << entry->name
<< setw(30) << entry->telNumber
<< entry->dt;
return out;
}
fstream& operator<<(fstream & out, const EntryNode *entry)
{
out << entry->name << ";"
<< entry->telNumber << ";";
out << entry->dt;
return out;
}