⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 encoder.h

📁 x-wrt is the GUI config tool for openwrt,which is a open project about wireless Router
💻 H
字号:
#if !defined encoder_h_included
#define encoder_h_included

#include "Common.h"


class XWRT_Encoder : public XWRT_Common
{
public:

	XWRT_Encoder();
	~XWRT_Encoder();

	void WRT_start_encoding(unsigned int fileLen,bool type_detected);

private:

	void WRT_encode(size_t bufferSize);
	inline void encodeCodeWord(int &i);
	inline void encodeSpaces();
	inline void encodeWord(unsigned char* s,int s_size,EWordType wordType,EXMLState& XMLState,int& c);
	inline void encodeCodeWord_PPM(int &i);
	inline void encodeCodeWord_LZMA(int &i);
	inline void encodeCodeWord_LZ(int &i);
	inline void encodeAsText(unsigned char* &s,int &s_size,EWordType wordType);
	inline int findShorterWord(unsigned char* &s,int &s_size);
	inline void toLower(unsigned char* s,int &s_size);
	inline void toUpper(unsigned char* s,int &s_size);
	inline void checkWord(unsigned char* &s,int &s_size,EXMLState& XMLState,int& c);
	inline void setSpaces(int c);
	inline void checkHashExactly(unsigned char* &s,int &s_size,int& i);
	inline int checkHash(unsigned char* &s,int &s_size,int h);
	inline void stringHash(const unsigned char *ptr, int len,int& hash);
	inline int unicode2utf8(unsigned int cp, unsigned char* result);
	void encodeMixed(unsigned char* s,int s_size,EXMLState& XMLState,int& c);
	void sortDict(int size);

	void write_dict(int comprLevel);
	int WRT_detectFileType();
	void WRT_detectFinish();
	void WRT_get_options(int& c,int& c2);
	inline void readGetcBuffer(FILE* &file,int &c);

	unsigned char utf8buff[4];
	int utf8cached;
	int utf8pos;

	int s_size,binCount;
	int last_c_bak,last_c,last_last_c,quotes,lastAll;
	EXMLState XMLState;

	unsigned char* getcBufferData;
	size_t getcBufferSize;
	size_t getcBufferSizeBak;
	int	getcBufferDataParts;
	unsigned char* getcBuffer;
	unsigned char* zlibBuffer;

	unsigned char* dynmem;
	unsigned char *dictbound;

public:
#ifdef USE_LZMA_LIBRARY
	COutFileStream* outStream;
	CMyComPtr<ISequentialOutStream> oStream;
#else
	COutFileStream* outStream;
#endif

}; // end class 

int compare_freq( const void *arg1, const void *arg2 );

#endif

⌨️ 快捷键说明

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