Permalink
Cannot retrieve contributors at this time
Name already in use
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
huffmanCoding/Compress.H
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
24 lines (16 sloc)
450 Bytes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#ifndef __COMPRESS_H__ | |
#define __COMPRESS_H__ | |
#include "Huffman.H" | |
using namespace std; | |
class Compress : public Huffman{ | |
int _counter; // Counts the number of bits used for compression (Needed for the header) | |
map<char,int> countLetters(); | |
string generateHeader(); | |
string generateBody(); | |
public: | |
Compress(string fname) : Huffman(fname), _counter(0){} | |
~Compress(){} | |
void generateTree(); | |
void compressFile(string outFile); | |
}; | |
#endif |