-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.cpp
43 lines (35 loc) · 834 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
30
31
32
33
34
35
36
37
38
39
40
41
/*
* main.cpp
*
* Created on: 08/04/2014
* Author: ari
*/
using namespace std;
#include <fstream>
#include "Compressor.h"
#include "Decompressor.h"
#include "gtest/gtest.h"
#include "contrib/gtest/gtest.h"
int main(int argc, char **argv) {
//::testing::InitGoogleTest(&argc, argv);
//return RUN_ALL_TESTS();
if(argc != 3){
cout << "Uso: " << endl;
cout << argv[0] << " -c archivoAComprimir"<< endl;
cout << argv[0] << " -d archivoADescomprimir"<< endl;
exit(1);
}
string path=argv[2];
if(!strcmp(argv[1],"-c")){
Compressor * comp = new Compressor();
comp->compress(path);
//remove(path.c_str());
delete comp;
}
if(!strcmp(argv[1],"-d")){
Decompressor * decomp = new Decompressor();
decomp->decompress(path);
delete decomp;
}
return 0;
}