-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcd.cpp
More file actions
59 lines (46 loc) · 1.02 KB
/
cd.cpp
File metadata and controls
59 lines (46 loc) · 1.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
#include "include.h"
int cd::getNb_pistes() const
{
return nb_pistes;
}
void cd::setNb_pistes(int value)
{
nb_pistes = value;
}
cd::cd()
{
}
cd::~cd()
{
}
cd::cd(type_ressource _type, int _id, std::string _titre, std::string _auteur, int _duree, std::string _maison_prod, int _nb_pistes, etat _etat) :
vhs(_type, _id, _titre, _auteur, _duree, _maison_prod, _etat), //vhs
nb_pistes(_nb_pistes) //cd
{
}
void cd::show() const
{
vhs::show();
cout << "Nombre de pistes: " << nb_pistes << endl;
}
void cd::save(std::ofstream &infile) const
{
vhs::save(infile);
infile<<nb_pistes<<endl;
}
void cd::load(std::istream &file)
{
string tampon;
vhs::load(file);
cout << "Combien y a-t-il de pistes sur ce CD?" << endl;
do{
getline( file, tampon);
}while(tampon.size()==0);
setNb_pistes(atoi(tampon.c_str()));
}
bool cd::search(std::string str) const
{
if (vhs::search(str))
return true;
return false;
}