-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
39 lines (34 loc) · 738 Bytes
/
main.cpp
File metadata and controls
39 lines (34 loc) · 738 Bytes
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
#include "Compress.h"
#include "Decompress.h"
#include <iostream>
#include <string>
#include <vector>
int main(int argc, char* argv[])
{
std::vector<std::string> args;
for (int i = 0; i < argc; i++)
args.push_back(std::string(argv[i]));
if (args.size() != 2)
{
std::cout << "Please use the correct number of arguments!" << std::endl;
exit(1);
}
// Compression
if (args[1] == "1")
{
Compress c("./text/");
c.run();
}
// Decompression
else if (args[1] == "2")
{
Decompress decomp("./text/");
decomp.run();
}
else
{
std::cout << "Please use a valid argument!" << std::endl;
exit(1);
}
return 0;
}