15 namespace fs = std::filesystem;
This file exports the constants used in throughout the project.
This class models a node structure used for building Huffman Binary Tree.
This class decompresses compressed(.huf) files to its original form.
void clear()
Resets all the attributes for next decompression operation.
std::ifstream infile
Instance of ifstream class for reading encoded characters from compressed file.
Queue< fileInfo > files
Queue of input file(s) to be decompressed.
void readHeader(const std::string &infileName, std::ifstream &infile)
Reads the header section from compressed file.
void deleteTree(BinNode *node)
Frees all heap storage associated with the Huffman Tree.
void decompressFile(const std::string &infileName)
Decompresses the compressed(.huf) file to its original form.
BinNode * rootNode
Root node for Huffman tree.
void writeIntoFile(const std::string &infileName)
Decodes encoded characters using the tree obtained from header section.
BinNode * readTree(std::ifstream &reader)
Reads the entire Huffman tree in to the file header section using a pre-order traversal algorithm.
This class models a linear structure called a Queue.
Structure to hold file metadata.
unsigned int fileSize
number of character in file.
fs::path filePath
path of file including filename and extension.
fileInfo(unsigned const int &fileSize, const fs::path &filePath)