-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathenum_string_type.cpp
45 lines (41 loc) · 979 Bytes
/
enum_string_type.cpp
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
#include "include.h"
type_ressource enum_string_type(std::string str_type)
{
type_ressource temp[]={LIVRE, REVUE, CD, VHS, DVD, RESSOURCE_NUM};
for (int i=0; i<6; i++)
{
if (str_type==type_string[i])
return temp[i];
}
return ERROR_RES;
}
std::string enum_string_type (type_ressource enum_type)
{
type_ressource temp[]={LIVRE, REVUE, CD, VHS, DVD, RESSOURCE_NUM};
for (int i=0; i<6;i++)
{
if (temp[i]==enum_type)
return type_string[i];
}
return "";
}
etat enum_string_etat(std::string str_type)
{
etat temp[]={DISPONIBLE, RESERVE, EMPRUNTE};
for (int i=0; i<3; i++)
{
if (str_type==etat_string[i])
return temp[i];
}
return ERROR_ET;
}
std::string enum_string_etat (etat enum_etat)
{
etat temp[]={DISPONIBLE, RESERVE, EMPRUNTE};
for (int i=0; i<6;i++)
{
if (temp[i]==enum_etat)
return etat_string[i];
}
return "";
}