This repository has been archived by the owner on Aug 13, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSaison.h
166 lines (142 loc) · 3.11 KB
/
Saison.h
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
158
159
160
161
162
163
164
165
166
#ifndef SAISON_H
#define SAISON_H
#include <QString>
#include "EntityStd.h"
#include "templatemanager.h"
/**
* @file Saison.h
* @version 1
* @brief Ce fichier est le header de la classe saison.
**/
/**
* @brief SaisonException class gère les exceptions sur Saison
*/
class SaisonException : public std::exception
{
protected :
std::string info;
public:
SaisonException(const std::string& i="") throw() :info(i) {}
const char* what() const throw()
{
return info.c_str();
}
~SaisonException()throw() {}
};
/**
* @brief Saison class gère les saisons hérite de EntityStd
*/
class Saison : public EntityStd
{
private:
/**
* @brief nom
*/
QString nom;
/**
* @brief description
*/
QString description;
public:
/**
* @brief getStrLabel
* @return retourne le nom
*/
std::string getStrLabel() const
{
return nom.toStdString();
}
/**
* @brief Saison
* @param n nom
* @param d descritption
*/
Saison(std::string n,std::string d);
/**
* @brief Saison
* @param n nom
* @param d descritption
*/
Saison(QString n,QString d);
/**
* @brief Saison
* @param n nom
* @param d descritption
*/
Saison(const char* n, const char*d);
/**
* @brief getNom getter du nom
* @return
*/
QString getNom() const {return nom;}
/**
* @brief getNom getter du nom
* @return
*/
std::string getNomStdString() const {return nom.toStdString();}
/**
* @brief getDescription getter de la description
* @return
*/
QString getDescription() const {return description;}
/**
* @brief getDescriptionStdString getter de la description
* @return
*/
std::string getDescriptionStdString() const {return description.toStdString();}
/**
* @brief setNom setter du nom
* @param n nom
*/
void setNom(QString n){nom = n;}
/**
* @brief setNom setter du nom
* @param n nom
*/
void setNom(std::string n){setNom(QString::fromStdString(n));}
/**
* @brief setNom setter du nom
* @param n nom
*/
void setNom(const char* n){setNom(std::string(n));}
/**
* @brief setDescription setter de description
* @param d
*/
void setDescription(QString d){description = d;}
/**
* @brief setDescription setter de description
* @param d
*/
void setDescription(std::string d){setDescription(QString::fromStdString(d));}
/**
* @brief setDescription setter de description
* @param d
*/
void setDescription(const char* d){setDescription(std::string(d));}
/**
* @brief destroy détruit proprement une Saison
*/
void destroy();
};
/**
* @brief operator ==
* @param s1
* @param s2
* @return
*/
bool operator ==(Saison s1,Saison s2);
/**
* @brief operator >
* @param s1
* @param s2
* @return
*/
bool operator >(Saison s1,Saison s2);
/**
* @brief StringToSaison
* @param s
* @return transforme une chaine de caractères en Saison
*/
Saison StringToSaison(const QString& s);
#endif // SAISON_H