📄 bz2.h
字号:
/*
BZClass
Copyright (c) 2003 by Gilad Novik (gilad@bmidas.com)
You are allowed to include the source code in any product (commercial, shareware, freeware or otherwise).
You are allowed to modify the source code in any way you want.
You can use this code without mention my name in your product, but it would be nice if you DO mention me.
*/
//////////////////////////////////////////////////////////////////////
#if !defined(AFX_BZ2_H__A6324CC8_60AE_4B57_8CA4_9B15B48B9000__INCLUDED_)
#define AFX_BZ2_H__A6324CC8_60AE_4B57_8CA4_9B15B48B9000__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#define BZ_NO_STDIO
#include "bzlib.h"
class CBZ2Base
{
protected:
CBZ2Base(char* pWriteBuffer,unsigned int nWriteBufferSize);
protected:
bz_stream m_Stream;
char* m_pWriteBuffer;
unsigned int m_nWriteBufferSize;
};
class CBZ2Compress : CBZ2Base
{
public:
CBZ2Compress(char* pWriteBuffer,unsigned int nWriteBufferSize,int nBlockSize=9,int nWorkFactor=30);
virtual ~CBZ2Compress();
public:
unsigned int Compress();
protected:
virtual unsigned int OnCompressRead(char* &pBuffer)=0;
virtual void OnCompressWrite(const char* pBuffer,unsigned int nLength)=0;
};
class CBZ2Decompress : CBZ2Base
{
public:
CBZ2Decompress(char* pWriteBuffer,unsigned int nWriteBufferSize,int nSmall=false);
virtual ~CBZ2Decompress();
public:
unsigned int Decompress();
protected:
virtual unsigned int OnDecompressRead(char* &pBuffer)=0;
virtual void OnDecompressWrite(const char* pBuffer,unsigned int nLength)=0;
};
#endif // !defined(AFX_BZ2_H__A6324CC8_60AE_4B57_8CA4_9B15B48B9000__INCLUDED_)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -