Frog Archiver 1.0
Frog Archiver is compression tools for any files you have.
Loading...
Searching...
No Matches
huffmanencoding.h
1#pragma once
2
3#include <QThread>
4#include <fstream>
5#include <iostream>
6#include <stdlib.h>
7
8using namespace std;
9
10class HuffmanEncoding : public QThread {
11 Q_OBJECT
12public:
14 static int bit_pos; // byte block (0-7)
15 static unsigned char temp_char;
16
17 void setInputFile(QStringList input) { inf = input; }
18
19 void setOutputFile(QString output) { of = output; }
20
21 void setTotalSize(int64_t totalsizeInput) { totalsize = totalsizeInput; }
22
23 void encoder();
24
25 void run() { encoder(); }
26
27private:
28 QStringList inf;
29 QString of;
30 int64_t totalsize;
31 QList<double> ratat;
32 QList<double> entropit;
33
34 int64_t tempsize;
35 QString activefile;
36
37 void huffmanWrite(unsigned char c, ofstream &outfile);
38
39signals:
40 void progressChanged(QString info);
41 void progressCounted(int progress);
42 void setEnabled(bool enable);
43};
Definition huffmanencoding.h:10
void encoder()
Definition huffmanencoding.cpp:54
HuffmanEncoding()
Definition huffmanencoding.cpp:17