@@ -20,31 +20,26 @@ PasswordDataBase::PasswordDataBase()
20
20
21
21
PasswordDataBase::~PasswordDataBase ()
22
22
{}
23
-
24
23
void PasswordDataBase::start ()
25
24
{
26
25
decryptDataFile ();
27
26
readToMap ();
28
27
showMenu ();
29
28
}
30
-
31
29
void PasswordDataBase::finish ()
32
30
{
33
31
writeFromMap ();
34
32
encryptDataFile ();
35
33
exit (0 );
36
34
}
37
-
38
35
void PasswordDataBase::decryptDataFile ()
39
36
{
40
37
cryptor.decryptFile ();
41
38
}
42
-
43
39
void PasswordDataBase::encryptDataFile ()
44
40
{
45
41
cryptor.encryptFile ();
46
42
}
47
-
48
43
void PasswordDataBase::readToMap ()
49
44
{
50
45
element_multi_map.clear ();
@@ -63,7 +58,6 @@ void PasswordDataBase::readToMap()
63
58
64
59
data_file.close ();
65
60
}
66
-
67
61
void PasswordDataBase::writeFromMap ()
68
62
{
69
63
if (!data_file.isOpen ())
@@ -98,7 +92,6 @@ void PasswordDataBase::writeFromMap()
98
92
99
93
data_file.close ();
100
94
}
101
-
102
95
void PasswordDataBase::showMap ()
103
96
{
104
97
short counter = 0 ;
@@ -114,7 +107,6 @@ void PasswordDataBase::showMap()
114
107
}
115
108
116
109
}
117
-
118
110
void PasswordDataBase::showMenu ()
119
111
{
120
112
while (true )
@@ -142,7 +134,6 @@ void PasswordDataBase::showMenu()
142
134
}
143
135
}
144
136
}
145
-
146
137
void PasswordDataBase::addElement ()
147
138
{
148
139
string name, note, password;
@@ -185,7 +176,6 @@ void PasswordDataBase::addElement()
185
176
element_multi_map.insertMulti (QString::fromStdString (name), QString::fromStdString (note));
186
177
element_multi_map.insertMulti (QString::fromStdString (name), QString::fromStdString (password));
187
178
}
188
-
189
179
void PasswordDataBase::showElement ()
190
180
{
191
181
string name, note, password;
@@ -230,7 +220,6 @@ void PasswordDataBase::showElement()
230
220
cin.ignore (10 , ' \n ' );
231
221
return ;
232
222
}
233
-
234
223
void PasswordDataBase::editElement ()
235
224
{
236
225
string new_name, name, note, password;
@@ -335,7 +324,6 @@ void PasswordDataBase::editElement()
335
324
new_name.clear ();
336
325
}
337
326
}
338
-
339
327
void PasswordDataBase::removeElement ()
340
328
{
341
329
string name;
@@ -365,12 +353,10 @@ void PasswordDataBase::removeElement()
365
353
cin.clear ();
366
354
cin.ignore (10 , ' \n ' );
367
355
}
368
-
369
356
void PasswordDataBase::wipeDataFile ()
370
357
{
371
358
element_multi_map.clear ();
372
359
}
373
-
374
360
string PasswordDataBase::generatePassword ()
375
361
{
376
362
string password;
@@ -409,7 +395,6 @@ string PasswordDataBase::generatePassword()
409
395
410
396
return password;
411
397
}
412
-
413
398
int PasswordDataBase::getSwitchChoice (int min, int max)
414
399
{
415
400
int value;
0 commit comments