-
Notifications
You must be signed in to change notification settings - Fork 0
/
Controller.h
42 lines (34 loc) · 935 Bytes
/
Controller.h
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
/*
* File: Controller.h
* Author: Anas
*
* Created on December 26, 2012, 6:18 PM
*/
#ifndef CONTROLLER_H
#define CONTROLLER_H
#include <string>
#include "HuffmanTree.h"
using namespace std;
class Controller {
private:
HuffmanTree * huffmanTree;
public:
void compressFile(string inputFileName, string outputFileName);
void decompressFile(string inputFileName, string outputFileName);
~Controller();
};
Controller::compressFile(string inputFileName, string outputFileName) {
huffmanTree = new HuffmanTree(inputFileName);
huffmanTree->doCompressedOutput(string outputFileName);
//huffmanTree->closeFiles();
}
Controller::decompressFile(string inputFileName, string outputFileName) {
this->huffmanTree->decompressFile(inputFileName, outputFileName);
}
Controller::~Controller() {
if (huffmanTree != 0) {
delete huffmanTree;
huffmanTree;
}
}
#endif /* CONTROLLER_H */