ZipFileManager.h
上传用户:wymy58
上传日期:2007-01-07
资源大小:2086k
文件大小:1k
源码类别:

DirextX编程

开发平台:

Visual C++

  1. // Copyright (C) 1999 DXGuide.  All Rights Reserved.
  2. // File: ZipFileManager.h
  3. #ifndef _ZIPFILEMANAGER__H
  4. #define _ZIPFILEMANAGER__H
  5. #if _MSC_VER >= 1000
  6. #pragma once
  7. #endif // _MSC_VER >= 1000
  8. #include "PackFileManagerBaseClass.h"
  9. struct ZipFileEntry;
  10. class CZipFileManager : public CPackFileManagerBaseClass
  11. {
  12. friend class CZipFile;
  13. public:
  14. enum ZipHeaderSignature
  15. {
  16. // Header signatures
  17. ZIPSIG_LOCSIG = 0x04034B50L, // "PK0304"
  18. ZIPSIG_EXTSIG = 0x08074B50L, // "PK0708"
  19. ZIPSIG_CENSIG = 0x02014B50L, // "PK0102"
  20. ZIPSIG_ENDSIG = 0x06054B50L, // "PK0506"
  21. };
  22. public:
  23. CZipFileManager(void);
  24. virtual ~CZipFileManager();
  25. public:
  26. virtual bool Load(LPCTSTR  lpszName, bool  bResource);
  27. virtual DWORD GetFileEntries(void) const
  28. {
  29. return  m_wEntries;
  30. }
  31. virtual PackFileManagerType GetPackFileManagerType(void) const;
  32. public:
  33. #ifdef _DEBUG
  34. bool List(void);
  35. #endif // _DEBUG
  36. protected:
  37. LONG LocateCentralDirectory(void);
  38. CString GetGlobalComment(void);
  39. protected:
  40. virtual bool GetFileEntryInfo(LPCTSTR  lpszName, CPackFileBaseClass*  pFileEntry) const;
  41. protected:
  42. CFile* m_pFile;
  43. ZipFileEntry* m_pFileEntryArray;
  44. WORD m_wEntries;
  45. DWORD m_offset_central_dir;
  46. WORD m_gi_size_comment;
  47. LONG m_lCentralPos;
  48. DWORD m_byte_before_the_zipfile;
  49. };
  50. #endif // _ZIPFILEMANAGER__H