-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMain.cpp
More file actions
22 lines (21 loc) · 741 Bytes
/
Copy pathMain.cpp
File metadata and controls
22 lines (21 loc) · 741 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#include "HuffmanCoding.h"
int main(int argc,char* argv[]){
int mode = 0 , mode_2 = 0;
mode=(argv[1][0]-'0');
string filePath="in.txt",fileName="out.txt";
/////////////////////////////////////////////////////////////////
Document File(filePath,fileName); //Construct FILE.
switch(mode){
case 0:
if(File.Init(0)){
if(!File.Encode())
cout<<"Encode failed. Check your file."<<endl;
}break;
case 1:
if(File.Init(1)){
if(!File.Decode())
cout<<"Invalid CodeTree. Check your file."<<endl;
}break;
}
return 0;
}