-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathHuffmanDriver.cpp
More file actions
50 lines (37 loc) · 1.24 KB
/
Copy pathHuffmanDriver.cpp
File metadata and controls
50 lines (37 loc) · 1.24 KB
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
45
46
47
48
49
50
#include <iostream>
#include "Huffman.h"
using namespace std;
int main()
{
Huffman *compressor = new Huffman();
int choice = 0;
string in_file, out_file;
cout << "Would you like to:" << endl
<< "1) Compress a file" << endl
<< "2) Decompress a file" << endl;
cin >> choice;
if (1 == choice) {
cout << "Enter the path of the file to be compressed: ";
cin >> in_file;
cout << "Enter the path where you'd like the decompress file to be saved: ";
cin >> out_file;
compressor->compress(in_file, out_file);
} else if (2 == choice) {
cout << "Enter the path of the file to be decompressed: ";
cin >> in_file;
cout << "Enter the path where you'd like the uncompressed file to be saved: ";
cin >> out_file;
compressor->decompress(in_file, out_file);
} else {
cout << "That is not a valid choice." << endl;
}
// string starting_string = "go go gophers for the win!";
// h->setText(starting_string);
// string encoded_string = h->encode();
// cout << encoded_string << endl;
//
// h->setEncodedText(encoded_string) ;
// string decoded_string = h->decode();
// cout << decoded_string << endl;
return 0;
}