MemZipFile.cpp 726 B

1234567891011121314151617181920212223242526272829303132333435
  1. #include "StdAfx.h"
  2. #include "MemZipFile.h"
  3. #include "..\ZLibWrapLib\Encoding.h"
  4. #include "io_mfc_mem.h"
  5. #define ZIP_GPBF_LANGUAGE_ENCODING_FLAG 0x800
  6. CMemZipFile::CMemZipFile(void):m_file(NULL)
  7. {
  8. fill_mfc_mem_filefunc(&m_pzlib_filefunc_def);
  9. m_file_inzip_open =FALSE;
  10. }
  11. CMemZipFile::CMemZipFile( CMemFile * pMemFile ):m_file(NULL)
  12. {
  13. fill_mfc_mem_filefunc(&m_pzlib_filefunc_def);
  14. m_file_inzip_open =FALSE;
  15. if(pMemFile!=NULL)OpenFile(pMemFile);
  16. }
  17. CMemZipFile::~CMemZipFile(void)
  18. {
  19. }
  20. void CMemZipFile::OpenFile( CMemFile* file )
  21. {
  22. m_file =file;
  23. m_pzlib_filefunc_def.opaque = m_file;
  24. zf=zipOpen2(NULL,0,NULL,&m_pzlib_filefunc_def);
  25. }
  26. void CMemZipFile::Open()
  27. {
  28. if(!m_IsZipOpened&& NULL!=m_file)OpenFile(m_file);
  29. }