|
// LZWCompression.h: interface for the CLZWCompression class.
//
//////////////////////////////////////////////////////////////////////
#if !defined(AFX_LZWCOMPRESSION_H__6C8D7CDC_4AF5_426D_A4AF_49682963D8C3__INCLUDED_)
#define AFX_LZWCOMPRESSION_H__6C8D7CDC_4AF5_426D_A4AF_49682963D8C3__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#include "Dictionary.h"
class CLZWCompression
{
public:
// These two functions were added to use the log file with the application
BOOL DecompressWithLog(CFile &source, CFile &destination, CStringArray *pLog);
BOOL CompressWithLog(CFile &source, CFile &destination, CStringArray *pLog = NULL);
void Log(CString data);
private:
CStringArray * p_Log;
public:
void ClearDictionary();
BOOL Decompress(CFile &source, CFile &destination);
BOOL Compress(CFile &source, CFile &destination);
void CreateDictionary();
CLZWCompression();
virtual ~CLZWCompression();
private:
CString convertASCIIToText(BYTE ascii);
void Init();
void CalculateBitSize(DWORD value);
void CloseCompressedFile(CFile &source);
DWORD DecompressData(CFile &source);
BYTE m_MaxBits;
DWORD m_MaxCode[32];
int m_TotalBits;
void CompressData(CFile &dest, long toSave);
DWORD m_SavedData;
CDictionary *m_dictionary;
};
#endif // !defined(AFX_LZWCOMPRESSION_H__6C8D7CDC_4AF5_426D_A4AF_49682963D8C3__INCLUDED_)
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.
A list of licenses authors might use can be found here
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.