ZipFile.h
资源名称:DXGuide.zip [点击查看]
上传用户:wymy58
上传日期:2007-01-07
资源大小:2086k
文件大小:2k
源码类别:
DirextX编程
开发平台:
Visual C++
- // Copyright (C) 1999 DXGuide. All Rights Reserved.
- // File: ZipFile.h
- #ifndef _ZIPFILE__H
- #define _ZIPFILE__H
- #if _MSC_VER >= 1000
- #pragma once
- #endif // _MSC_VER >= 1000
- #include "PackFileBaseClass.h"
- #ifdef _DEBUG
- #include "CheckSum.h"
- #endif // _DEBUG
- class CInflater;
- class CZipFile : public CPackFileBaseClass
- {
- friend class CZipFileManager;
- public:
- CZipFile(void);
- virtual ~CZipFile();
- public:
- virtual bool Open(CPackFileManagerBaseClass* pPackFileManager, LPCTSTR lpszName);
- public:
- virtual int Read(LPVOID pBuf, int nSize);
- virtual LONG Seek(LONG lOff, CFile::SeekPosition seekPos = CFile::begin);
- virtual LONG Tell(void) const;
- virtual LONG GetFileSize(void) const;
- virtual CString GetFileName(void) const
- {
- return m_strName;
- }
- public:
- // Returns true if this is a directory entry. A directory
- // entry is defined to be one whose name ends with a '/'.
- bool IsDirectory(void) const
- {
- return m_strName[m_strName.GetLength() - 1] == _T('/');
- }
- LONG Rewind(void);
- // internal information about a file in zipfile, when reading and decompress it
- protected:
- CFile* m_pFile;
- CString m_strName; // entry name
- WORD m_wFlag;
- WORD m_wCompressionMethod; // compression method (0 == store)
- DWORD m_dwDosTime;
- DWORD m_dwCrc32;
- DWORD m_dwCompressedSize;
- DWORD m_dwUncompressedSize;
- LONG m_lStartPos;
- LONG m_lCurPosInZipFile; // position in byte on the zipfile
- protected:
- BYTE* m_pInputBuf; // internal buffer for compressed data
- CInflater* m_pInflater; // for inflate
- #ifdef _DEBUG
- CChecksum m_checksum; // crc32 of all data uncompressed
- #endif // _DEBUG
- };
- #endif // _ZIPFILE__H