FileZipFile.cpp 637 B

1234567891011121314151617181920212223242526272829303132
  1. #include "StdAfx.h"
  2. #include "FileZipFile.h"
  3. #include "io_mfc_file.h"
  4. CFileZipFile::CFileZipFile(void):m_file(NULL)
  5. {
  6. fill_mfc_filefunc(&m_pzlib_filefunc_def);
  7. m_file_inzip_open =FALSE;
  8. }
  9. CFileZipFile::CFileZipFile( CFile * pMemFile ):m_file(NULL)
  10. {
  11. fill_mfc_filefunc(&m_pzlib_filefunc_def);
  12. m_file_inzip_open =FALSE;
  13. if(pMemFile!=NULL)OpenFile(pMemFile);
  14. }
  15. CFileZipFile::~CFileZipFile(void)
  16. {
  17. }
  18. void CFileZipFile::OpenFile( CFile* file )
  19. {
  20. m_file =file;
  21. m_pzlib_filefunc_def.opaque = m_file;
  22. zf=zipOpen2(NULL,0,NULL,&m_pzlib_filefunc_def);
  23. }
  24. void CFileZipFile::Open()
  25. {
  26. if(!m_IsZipOpened&& NULL!=m_file)OpenFile(m_file);
  27. }