-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.cpp
29 lines (25 loc) · 872 Bytes
/
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
#include <iostream>
#include <string.h>
#include "decompression.cpp"
int main(int argv, char **argc) {
double elapsed_time = 0;
if(argv == 4) {
char operation = argc[1][0];
char* in_file = argc[2];
char* out_file = argc[3];
if(operation == 'c') {
elapsed_time = compress_file(in_file, out_file);
cout << "COMPRESSAO" << endl << endl;
cout << "Tempo decorrido: " << fixed << elapsed_time << " segundos" << endl;
} else if(operation == 'd') {
elapsed_time = decompress_file(in_file, out_file);
cout << "DESCOMPRESSAO" << endl << endl;
cout << "Tempo decorrido: " << fixed << elapsed_time << " segundos" << endl;
}
} else {
cout << "Modo de uso" << endl << endl;
cout << "COMPRIMIR: Digite c entrada.extensao saida.extensao" << endl;
cout << "DESCOMPRIMIR: Digite d entrada.extensao saida.extensao" << endl;
}
return 0;
}