lzw.h

来自「Implementation for Lempel-Ziv code. E」· C头文件 代码 · 共 37 行

H
37
字号
#pragma once

#include <io.h>
#include <fcntl.h>
#include <sys/types.h>
#include <sys/stat.h>

#include <string>
#include <list>
#include <algorithm>
#include <limits.h>

#include <fstream>

#define SYMBOL_TYPE unsigned char
#define SYMBOL_SIZE 1
#define SYMBOL_MAX 255
#define BYTES_LIMIT 2

class LZW
{
public:
	LZW(void);
public:
	~LZW(void);

public:
	void Compress(const std::string& sInput, const std::string& sOutput);
	void Decompress(const std::string& SInput, const std::string& sOutput);
private:
	int Search(const std::list <std::string>& T, const std::string& w);
	bool FindIndex(const std::list <std::string>& T, int i, std::string& w);
	int Write(int fdOut, int x);
	int Write(int fdOut, const std::string& w);

};

⌨️ 快捷键说明

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