-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGenre.cpp
More file actions
157 lines (152 loc) · 3.02 KB
/
Copy pathGenre.cpp
File metadata and controls
157 lines (152 loc) · 3.02 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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
#ifndef GENRE_CPP
#define GENRE_CPP
#include <string>
using namespace std;
enum Genre
{
Action,
Adventure,
Animation,
Biography,
Comedy,
Crime,
Documentary,
Drama,
Fantasy,
Family,
FilmNoir,
GameShow,
History,
Horror,
Music,
Musical,
Mystery,
News,
RealityTV,
Romance,
SciFi,
Short,
Sport,
Thriller,
Western,
War,
Invalid
};
Genre convert(string g)
{
if (g == "Action")
return Action;
else if (g == "Adventure")
return Adventure;
else if (g == "Animation")
return Animation;
else if (g == "Biography")
return Biography;
else if (g == "Crime")
return Crime;
else if (g == "Comedy")
return Comedy;
else if (g == "Documentary")
return Documentary;
else if (g == "Drama")
return Drama;
else if (g == "Fantasy")
return Fantasy;
else if (g == "Family")
return Family;
else if (g == "Film-Noir")
return FilmNoir;
else if (g == "Game-Show")
return GameShow;
else if (g == "History")
return History;
else if (g == "Horror")
return Horror;
else if (g == "Music")
return Music;
else if (g == "Musical")
return Musical;
else if (g == "Mystery")
return Mystery;
else if (g == "News")
return News;
else if (g == "Reality-TV")
return RealityTV;
else if (g == "Romance")
return Romance;
else if (g == "Sci-Fi")
return SciFi;
else if (g == "Short")
return Short;
else if (g == "Sport")
return Sport;
else if (g == "Thriller")
return Thriller;
else if (g == "Western")
return Western;
else if (g == "War")
return War;
else
return Invalid;
}
string toString(Genre g)
{
switch (g)
{
case Action:
return "Action";
case Adventure:
return "Adventure";
case Animation:
return "Animation";
case Biography:
return "Biography";
case Crime:
return "Crime";
case Comedy:
return "Comedy";
case Documentary:
return "Documentary";
case Drama:
return "Drama";
case Fantasy:
return "Fantasy";
case Family:
return "Family";
case FilmNoir:
return "Film-Noir";
case GameShow:
return "Game-Show";
case History:
return "History";
case Horror:
return "Horror";
case Music:
return "Music";
case Musical:
return "Musical";
case Mystery:
return "Mystery";
case News:
return "News";
case RealityTV:
return "Reality-TV";
case Romance:
return "Romance";
case SciFi:
return "Sci-Fi";
case Short:
return "Short";
case Sport:
return "Sport";
case Thriller:
return "Thriller";
case Western:
return "Western";
case War:
return "War";
default:
return "Invalid";
}
}
#endif