-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathClassic.cpp
More file actions
69 lines (58 loc) · 1.33 KB
/
Classic.cpp
File metadata and controls
69 lines (58 loc) · 1.33 KB
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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
#include "Classic.h"
Classic::Classic(string input)
{
stringstream info(input);
string temp;
info >> stock;
remaining = stock; //none borrowed
info.ignore();
info.ignore();
getline(info, director, ',');
info.ignore();
getline(info, title, ',');
info.ignore();
getline(info, actor, ' ');
getline(info, temp, ' '); //gets last name
actor += " " + temp; //combine name
info >> month;
info >> year;
generateIndex();
}
//creates an index for storing in store inventory
void Classic::generateIndex() {
string monthHelp = to_string(month);
if (monthHelp.length() == 1) //single dig month
{
monthHelp = "0" + monthHelp; //fix single digit month
}
indexer = CLASSIC; //each genre has uniq tag for sorting
indexer.append(to_string(year)).append(monthHelp)
.append(actor);
}
bool Classic::operator<(Classic)
{
return false;
}
bool Classic::operator>(Classic)
{
return false;
}
bool Classic::operator==(Classic)
{
return false;
}
void Classic::display()
{
cout << "C, " << stock << ", " << director
<< ", " << title << ", " << actor << " "
<< month << " " << year << endl;
}
string Classic::transDisplay()
{
string tran = "C, " + director + ", " + title + ", " + actor +
" " + to_string(month) + " " + to_string(year);
return tran;
}
Classic::~Classic()
{
}