textquery.h

来自「文件压缩与解压」· C头文件 代码 · 共 40 行

H
40
字号
# ifndef TEXTQUERY_CLASS
# define TEXTQUERY_CLASS

# include <iostream>
# include <fstream>
# include <map>
# include <string>
# include <vector>
# include <string>
# include <bitset>

using namespace std;

# include "Heap.h"
# include "ExtBinTree.h"


class TextQuery
{
public:
	TextQuery():sum(0){}
	void BuildMap(ifstream& in,string file_name);
	map<char,int>& GetMap(){return m;}
	ExtBinTree<char>* HuffumanTree();
	void Encode();
	int Decode(char& ch,string& str,string file_name);
	void Compress(ifstream& in,string source_file,ofstream& on,string destination_file);
	void Depress(ifstream& in,string source_file,ofstream& on,string destination_file);
	size_t sum;
	size_t last;
	string str;
	string strall;
	string strpre;
private:
	ExtBinTree<char>* tree;
	map<char,int> m;
	map<char,string> huffumancode;
};

# endif

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?