-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlivre.cpp
More file actions
34 lines (32 loc) · 1.29 KB
/
livre.cpp
File metadata and controls
34 lines (32 loc) · 1.29 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
#include <iostream>
#include "livre.h"
using namespace std;
Livre::Livre(): titre_("Inconnu"), auteur_(), genre_("Inconnu"), langue_("Inconnu"), datePublication_(), isbn_(0), nbExemplaires_(0) ,disponible_(true){}
Livre::Livre(const std::string& titre, const Auteur& auteur,const std::string& genre ,const std::string& langue, const Date& datePublication,int isbn, int nbExemplaires, bool disponible)
: titre_(titre), auteur_(auteur), genre_(genre), langue_(langue), datePublication_(datePublication), isbn_(isbn), nbExemplaires_(nbExemplaires), disponible_(disponible) {}
int Livre::getIsbn() const {
return isbn_;
}
int Livre::getNbExemplaires() const {
return nbExemplaires_;
}
void Livre::afficherInfo() const {
cout << "Titre: " << titre_ << endl;
cout << "Auteur: " ;
auteur_.afficherInfo();
cout << "Genre: " << genre_ << endl;
cout << "Langue: " << langue_ << endl;
cout << "Date de Publication: ";
datePublication_.printDate();
cout << "ISBN: " << isbn_ << endl;
cout << "Nombre d'Exemplaires: " << nbExemplaires_ << endl;
}
bool Livre::estDisponible() const {return disponible_;}
void Livre::emprunter(int lecteurid) {
disponible_=false;
listIdEmprunteur.push_back(lecteurid);
}
void Livre::restituer() {
disponible_=true;
afficherInfo();
}