Skip to content

Commit 048a70f

Browse files
committed
update
1 parent 6f7e1b9 commit 048a70f

25 files changed

+1003
-904
lines changed

header/AdressePostale.hpp

Lines changed: 32 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -9,37 +9,38 @@ namespace Heritage
99

1010
class AdressePostale
1111
{
12-
private:
13-
int numero;
14-
int code_postale;
15-
string rue;
16-
string complement;
17-
string ville;
18-
public:
19-
AdressePostale(int numero, string rue, string complement, int code_postale, string ville)
20-
{
21-
this->numero = numero;
22-
this->rue = rue;
23-
this->complement = complement;
24-
this->ville = ville;
25-
this->code_postale = code_postale;
26-
}
27-
28-
~AdressePostale(){}
29-
30-
int get_numero(){return this->numero;}
31-
int get_code_postale(){return this->code_postale;}
32-
string get_rue(){return this->rue;}
33-
string get_complement(){return this->complement;}
34-
string get_ville(){return this->ville;}
35-
36-
void set_numero(int numero){this->numero = numero;}
37-
void set_code_postale(int ){this->code_postale = code_postale;}
38-
void set_rue(string rue){this->rue = rue;}
39-
void set_complement(string complement){this->complement = complement;}
40-
void set_ville(string ville){this->ville = ville;}
41-
void infos();
12+
private:
13+
int numero;
14+
int code_postale;
15+
string rue;
16+
string complement;
17+
string ville;
18+
19+
public:
20+
AdressePostale(int numero, string rue, string complement, int code_postale, string ville)
21+
{
22+
this->numero = numero;
23+
this->rue = rue;
24+
this->complement = complement;
25+
this->ville = ville;
26+
this->code_postale = code_postale;
27+
}
28+
29+
~AdressePostale() {}
30+
31+
int get_numero() { return this->numero; }
32+
int get_code_postale() { return this->code_postale; }
33+
string get_rue() { return this->rue; }
34+
string get_complement() { return this->complement; }
35+
string get_ville() { return this->ville; }
36+
37+
void set_numero(int numero) { this->numero = numero; }
38+
void set_code_postale(int) { this->code_postale = code_postale; }
39+
void set_rue(string rue) { this->rue = rue; }
40+
void set_complement(string complement) { this->complement = complement; }
41+
void set_ville(string ville) { this->ville = ville; }
42+
void infos();
4243
};
4344
}
4445

45-
#endif //ADR_PST_H_FILE
46+
#endif // ADR_PST_H_FILE

header/Annuaire.hpp

Lines changed: 37 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -11,47 +11,46 @@ using namespace std;
1111
using namespace MapTools;
1212
using namespace Heritage;
1313

14-
1514
namespace Manage
1615
{
17-
class Annuaire: public Tools<string, int, Contact>
16+
class Annuaire : public Tools<string, int, Contact>
1817
{
19-
private:
20-
Utils * utils;
21-
22-
public:
23-
Annuaire(){ this->utils = new Utils();}
24-
~Annuaire()
25-
{
26-
delete this->utils;
27-
this->utils = nullptr;
28-
}
29-
30-
/*virtual*/ void add_new_elt(Contact *contact) override;
31-
/*virtual*/ void delete_elt_by_key(string key) override;
32-
/*virtual*/ void delete_elt_by_id(int pid) override;
33-
/*virtual*/ void update_elt_by_id(int pid) override;
34-
/*virtual*/ Contact *get_elt_by_email(string email) override;
35-
/*virtual*/ Contact *get_elt_by_key(string key) override;
36-
/*virtual*/ vector<Contact*> get_list_elts_by_keys(vector<string> keys) override;
37-
/*virtual*/ Contact *get_elt_by_id(int pid) override;
38-
/*virtual*/ vector<Contact*> get_list_elts_by_last_name(string lastname) override;
39-
/*virtual*/ vector<Contact*> get_list_elts_by_first_name(string firstname) override;
40-
/*virtual*/ vector<Contact*> get_list_elts_by_zip_code(int zip_code) override;
41-
/*virtual*/ vector<Contact*> get_list_elts_by_department(int departement) override;
42-
/*virtual*/ vector<Contact*> get_list_elts_by_town(string town) override;
43-
44-
/*virtual*/ int size_list() override;
45-
/*virtual*/ int check_elt_by_key(string key) override;
46-
/*virtual*/ string build_key(Contact *contact) override;
47-
48-
void load_annuaire_from_files(string fileContactPrivate, string fileContactPro);
49-
void buildContactPro(string fileContactPro);
50-
void buildContactPrive(string fileContactPro);
51-
DateNaissance *build_date_naissance(string date_naissance_str);
52-
map<string, Contact*> get_map_annuaire();
53-
54-
int get_next_pid();
18+
private:
19+
Utils *utils;
20+
21+
public:
22+
Annuaire() { this->utils = new Utils(); }
23+
~Annuaire()
24+
{
25+
delete this->utils;
26+
this->utils = nullptr;
27+
}
28+
29+
/*virtual*/ void add_new_elt(Contact *contact) override;
30+
/*virtual*/ void delete_elt_by_key(string key) override;
31+
/*virtual*/ void delete_elt_by_id(int pid) override;
32+
/*virtual*/ void update_elt_by_id(int pid) override;
33+
/*virtual*/ Contact *get_elt_by_email(string email) override;
34+
/*virtual*/ Contact *get_elt_by_key(string key) override;
35+
/*virtual*/ vector<Contact *> get_list_elts_by_keys(vector<string> keys) override;
36+
/*virtual*/ Contact *get_elt_by_id(int pid) override;
37+
/*virtual*/ vector<Contact *> get_list_elts_by_last_name(string lastname) override;
38+
/*virtual*/ vector<Contact *> get_list_elts_by_first_name(string firstname) override;
39+
/*virtual*/ vector<Contact *> get_list_elts_by_zip_code(int zip_code) override;
40+
/*virtual*/ vector<Contact *> get_list_elts_by_department(int departement) override;
41+
/*virtual*/ vector<Contact *> get_list_elts_by_town(string town) override;
42+
43+
/*virtual*/ int size_list() override;
44+
/*virtual*/ int check_elt_by_key(string key) override;
45+
/*virtual*/ string build_key(Contact *contact) override;
46+
47+
void load_annuaire_from_files(string fileContactPrivate, string fileContactPro);
48+
void buildContactPro(string fileContactPro);
49+
void buildContactPrive(string fileContactPro);
50+
DateNaissance *build_date_naissance(string date_naissance_str);
51+
map<string, Contact *> get_map_annuaire();
52+
53+
int get_next_pid();
5554
};
5655
}
5756
#endif // MAGASIN_H_FILE

header/Console.hpp

Lines changed: 43 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -14,54 +14,53 @@ using namespace std;
1414

1515
namespace Manage
1616
{
17-
1817
class Console
1918
{
2019

21-
private:
22-
Annuaire * annuaire;
23-
string get_str_value(string key);
24-
Utils * utils;
25-
Display * display;
20+
private:
21+
Annuaire *annuaire;
22+
string get_str_value(string key);
23+
Utils *utils;
24+
Display *display;
2625

27-
public:
28-
Console()
29-
{
30-
this->annuaire = new Annuaire();
31-
this->utils = new Utils();
32-
this->display = new Display();
33-
}
34-
~Console()
35-
{
36-
delete this->annuaire;
37-
this->annuaire = nullptr;
38-
delete this->utils;
39-
this->utils = nullptr;
40-
delete this->display;
41-
this->display = nullptr;
42-
}
43-
Annuaire *get_annuaire()
44-
{
45-
return this->annuaire;
46-
}
47-
void afficher_annuaire();
48-
void afficher_annuaire_prive();
49-
void afficher_annuaire_pros();
50-
void ajouter_contact_prive();
51-
void ajouter_contact_professionnel();
52-
void rechercher_contact_pid();
53-
void rechercher_contact_nom();
54-
void rechercher_contact_prenom();
55-
void rechercher_contact_email();
56-
void rechercher_contact_code_postale();
57-
void rechercher_contact_departement();
58-
void rechercher_contact_ville();
59-
void supprimer_contact_pid();
60-
void modifier_contact_pid();
61-
void load_datas(string fileContactPrivate, string fileContactPro);
62-
AdressePostale *new_address();
63-
int get_next_pid();
64-
bool check_email(string email);
26+
public:
27+
Console()
28+
{
29+
this->annuaire = new Annuaire();
30+
this->utils = new Utils();
31+
this->display = new Display();
32+
}
33+
~Console()
34+
{
35+
delete this->annuaire;
36+
this->annuaire = nullptr;
37+
delete this->utils;
38+
this->utils = nullptr;
39+
delete this->display;
40+
this->display = nullptr;
41+
}
42+
Annuaire *get_annuaire()
43+
{
44+
return this->annuaire;
45+
}
46+
void afficher_annuaire();
47+
void afficher_annuaire_prive();
48+
void afficher_annuaire_pros();
49+
void ajouter_contact_prive();
50+
void ajouter_contact_professionnel();
51+
void rechercher_contact_pid();
52+
void rechercher_contact_nom();
53+
void rechercher_contact_prenom();
54+
void rechercher_contact_email();
55+
void rechercher_contact_code_postale();
56+
void rechercher_contact_departement();
57+
void rechercher_contact_ville();
58+
void supprimer_contact_pid();
59+
void modifier_contact_pid();
60+
void load_datas(string fileContactPrivate, string fileContactPro);
61+
AdressePostale *new_address();
62+
int get_next_pid();
63+
bool check_email(string email);
6564
};
6665

6766
}

0 commit comments

Comments
 (0)