-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmain.cpp
44 lines (39 loc) · 1.19 KB
/
main.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
#include <stdlib.h>
#include <iostream>
#include "Manager.h"
#include "VirtualHD.h"
using namespace std;
int main() {
Manager manageHDS;
string option,
name;
manageHDS.loadHD();
do {
cout << manageHDS.getPath();
cin >> option;
if (option == "createhd") {
manageHDS.writeHD();
} else if (option.find(":") != string::npos) {
string hdSearch;
hdSearch = option.replace(option.size()-1,1,"");
if (manageHDS.searchHD(hdSearch)) {
manageHDS.HDS[hdSearch].openHD();
}else
cout << "HD nao existente" << endl;
}else if(option == "formathd"){
cin >> name;
cin.get();
manageHDS.formatHD(name);
}else if(option == "dirhd"){
manageHDS.printHDS();
}else if(option == "removehd") {
manageHDS.removeHD();
}else if(option == "statushd"){
manageHDS.statusHD();
}else if(option == "?" || option == "help"){
manageHDS.help();
}else if(option != "exit"){
cout << "Comando nao existente!" << endl;
}
}while(option != "exit");
}