亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來(lái)到蟲(chóng)蟲(chóng)下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲(chóng)蟲(chóng)下載站

?? unzipfile.cpp

?? 本程序所用壓縮函數(shù)庫(kù)在子目錄zipfunc中,在zipfunc目錄下,有兩個(gè)子目錄分別包含Release版和Debug版的zipfunc.lib,兩者都是共享鏈接庫(kù)編譯生成.同樣,主程序的鏈接也必須用
?? CPP
?? 第 1 頁(yè) / 共 2 頁(yè)
字號(hào):
// UnzipFile.cpp: implementation of the CUnzipFile class.
//
//////////////////////////////////////////////////////////////////////

#include "stdafx.h"
#include "UnzipFile.h"

#define SIZECENTRALDIRITEM (0x2e)
#define SIZEZIPLOCALHEADER (0x1e)


#ifndef UNZ_BUFSIZE
#define UNZ_BUFSIZE (16384)
#endif

#ifndef UNZ_MAXFILENAMEINZIP
#define UNZ_MAXFILENAMEINZIP (256)
#endif

#define BUFREADCOMMENT (0x400)


#define UNZ_PARAMERROR                  (-102)
#define UNZ_BADZIPFILE                  (-103)
#define UNZ_CRCERROR                    (-105)

unz_s::unz_s()
{
	pfile_in_zip_read = NULL;
}

void unz_s::alloc_pfile_in_zip_read()
{
	if (!pfile_in_zip_read)
		pfile_in_zip_read = new file_in_zip_read_info;
}

void unz_s::free_pfile_in_zip_read()
{
	if (pfile_in_zip_read)
	{
		delete pfile_in_zip_read;
		pfile_in_zip_read = NULL;
	}

}

unz_s::~unz_s()
{
	free_pfile_in_zip_read();
}

file_in_zip_read_info::file_in_zip_read_info()
{
	read_buffer = new char[UNZ_BUFSIZE];
	stream_initialised  = 0;
	pos_local_extrafield = 0;
	crc32 = 0;
	stream.total_out = 0;
}


file_in_zip_read_info::~file_in_zip_read_info()
{
	delete[] read_buffer;
}


//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////

CUnzipFile::CUnzipFile()
{
	m_bZipFile = false;
	m_pFile = &uf.file;
}


CUnzipFile::CUnzipFile(LPCTSTR lpszPath)
{
	m_bZipFile = false;
	m_pFile = &uf.file;
	Open(lpszPath);
}

//   Close a ZipFile
void CUnzipFile::Close()
{
	if (IsClosed())
		return;

    if (uf.pfile_in_zip_read)
        CloseCurrentFile();
	
	uf.file.Close();
}

//   Close the file in zip opened with OpenCurrentFile
void CUnzipFile::CloseCurrentFile()
{

	if (uf.pfile_in_zip_read == NULL)
		return; // already closed - do not throw an exception

	if (uf.pfile_in_zip_read->rest_read_uncompressed == 0)
	{
		if (uf.pfile_in_zip_read->crc32 != uf.pfile_in_zip_read->crc32_wait)
			ThrowError(UNZ_CRCERROR);
	}

	
	if (uf.pfile_in_zip_read->stream_initialised)
		inflateEnd(&uf.pfile_in_zip_read->stream);

	uf.free_pfile_in_zip_read();

}

/*
  Set the current file of the zipfile to the first file.
*/
void CUnzipFile::GoToFirstFile()
{
	uf.pos_in_central_dir = uf.offset_central_dir;
	uf.num_file = 0;
	unzlocal_GetCurrentFileInfoInternal(uf.cur_file_info,
										uf.cur_file_info_internal,
										NULL,0,NULL,0,NULL,0);
	uf.current_file_ok = 1;
}


/*
  Try locate the file szFileName in the zipfile.

  return value :
  true if the file is found. It becomes the current file.
  false if the file is not found
*/
bool CUnzipFile::LocateFile(CString szFileName, bool bCaseSensitive)
{

    if (szFileName.GetLength() >= UNZ_MAXFILENAMEINZIP)
        ThrowError(UNZ_PARAMERROR);

	if (!uf.current_file_ok)
		return false;

	uLong num_fileSaved = uf.num_file;
	uLong pos_in_central_dirSaved = uf.pos_in_central_dir;

	GoToFirstFile();

	bool res = true;
	while (res)
	{
		char szCurrentFileName[UNZ_MAXFILENAMEINZIP+1];
		GetCurrentFileInfo(NULL, szCurrentFileName, sizeof(szCurrentFileName)-1,
								NULL,0,NULL,0);
		if (StringFileNameCompare(szCurrentFileName, szFileName, bCaseSensitive)==0)
			return true;

		res = GoToNextFile();
	}

	uf.num_file = num_fileSaved ;
	uf.pos_in_central_dir = pos_in_central_dirSaved ;

	return false;
}



/*
  Set the current file of the zipfile to the next file.
  return true if there is no problem
  return false if the actual file was the latest.
*/
bool CUnzipFile::GoToNextFile()
{
	if (!uf.current_file_ok)
		return false;

	if (uf.num_file + 1 == uf.gi.number_entry)
		return false;

	uf.pos_in_central_dir += SIZECENTRALDIRITEM + uf.cur_file_info.size_filename +
			uf.cur_file_info.size_file_extra + uf.cur_file_info.size_file_comment ;

	uf.num_file++;
	unzlocal_GetCurrentFileInfoInternal(uf.cur_file_info,
										uf.cur_file_info_internal,
										NULL,0,NULL,0,NULL,0);
	uf.current_file_ok = 1;
	return true;
}

/*
  Read the local header of the current zipfile
  Check the coherency of the local header and info in the end of central
        directory about this file
  store in *piSizeVar the size of extra info in local header
        (filename and size of extra field data)
*/
void CUnzipFile::unzlocal_CheckCurrentFileCoherencyHeader (uInt & iSizeVar,
													uLong & offset_local_extrafield,
													uLong & size_local_extrafield)
{

	iSizeVar = 0;
	offset_local_extrafield = 0;
	size_local_extrafield = 0;

	uf.file.Seek(uf.cur_file_info_internal.offset_curfile + uf.byte_before_the_zipfile, CFile::begin);

	uLong uMagic;
	unzlocal_getLong(uMagic);
	if (uMagic!=0x04034b50)
		ThrowError(UNZ_BADZIPFILE);

	uLong uData;
	unzlocal_getShort(uData);

// 	if (uData != uf.cur_file_info.version)
// 		ThrowError(UNZ_BADZIPFILE);

	uLong uFlags;
	unzlocal_getShort(uFlags);

	unzlocal_getShort(uData);
	if (uData != uf.cur_file_info.compression_method)
		ThrowError(UNZ_BADZIPFILE);

    if ((uf.cur_file_info.compression_method != 0) &&
                         (uf.cur_file_info.compression_method != Z_DEFLATED))
        ThrowError(UNZ_BADZIPFILE);

	unzlocal_getLong(uData); /* date/time */

	unzlocal_getLong(uData); /* crc */
	if ((uData != uf.cur_file_info.crc) &&
		                      ((uFlags & 8)==0))
		ThrowError(UNZ_BADZIPFILE);

	unzlocal_getLong(uData); /* size compr */

	if ((uData != uf.cur_file_info.compressed_size) &&
							  ((uFlags & 8) == 0))
		ThrowError(UNZ_BADZIPFILE);

	unzlocal_getLong(uData); /* size uncompr */

	if ((uData!=uf.cur_file_info.uncompressed_size) && 
							  ((uFlags & 8)==0))
		ThrowError(UNZ_BADZIPFILE);

	uLong size_filename;
	unzlocal_getShort(size_filename);

	if ((size_filename != uf.cur_file_info.size_filename))
		ThrowError(UNZ_BADZIPFILE);

	iSizeVar = (uInt)size_filename;

	uLong size_extra_field;
	unzlocal_getShort(size_extra_field);

	offset_local_extrafield = uf.cur_file_info_internal.offset_curfile +
									SIZEZIPLOCALHEADER + size_filename;
	size_local_extrafield = (uInt)size_extra_field;

	iSizeVar += (uInt)size_extra_field;

}


//   Open for reading data the current file in the zipfile.
void CUnzipFile::OpenCurrentFile()
{

	ASSERT(uf.current_file_ok);

	if (!uf.current_file_ok)
		ThrowError(UNZ_PARAMERROR);

    if (uf.pfile_in_zip_read)
        CloseCurrentFile();

	uInt iSizeVar;
	uLong offset_local_extrafield;  /* offset of the local extra field */
	uLong  size_local_extrafield;    /* size of the local extra field */

	unzlocal_CheckCurrentFileCoherencyHeader(iSizeVar,
				offset_local_extrafield, size_local_extrafield);

	uf.alloc_pfile_in_zip_read();


	uf.pfile_in_zip_read->offset_local_extrafield = offset_local_extrafield;
	uf.pfile_in_zip_read->size_local_extrafield = size_local_extrafield;

	
	if ((uf.cur_file_info.compression_method!=0) &&
        (uf.cur_file_info.compression_method!=Z_DEFLATED))
		ThrowError(UNZ_BADZIPFILE);


	uf.pfile_in_zip_read->crc32_wait = uf.cur_file_info.crc;
	uf.pfile_in_zip_read->compression_method =
            uf.cur_file_info.compression_method;
	
	uf.pfile_in_zip_read->byte_before_the_zipfile=uf.byte_before_the_zipfile;


	if (uf.cur_file_info.compression_method != 0)
	{
	  uf.pfile_in_zip_read->stream.zalloc = (alloc_func)myalloc;
	  uf.pfile_in_zip_read->stream.zfree = (free_func)myfree;
	  uf.pfile_in_zip_read->stream.opaque = m_bDetectZlibMemoryLeaks ? &m_list : 0;
      
	  int err = inflateInit2(&uf.pfile_in_zip_read->stream, -MAX_WBITS);

	  if (err == Z_OK)
	    uf.pfile_in_zip_read->stream_initialised=1;
	  else 
		  CheckForError(err);
        /* windowBits is passed < 0 to tell that there is no zlib header.
         * Note that in this case inflate *requires* an extra "dummy" byte
         * after the compressed stream in order to complete decompression and
         * return Z_STREAM_END. 
         * In unzip, i don't wait absolutely Z_STREAM_END because I known the 
         * size of both compressed and uncompressed data
         */
	}
	uf.pfile_in_zip_read->rest_read_compressed = 
            uf.cur_file_info.compressed_size ;
	uf.pfile_in_zip_read->rest_read_uncompressed = 
            uf.cur_file_info.uncompressed_size ;

	
	uf.pfile_in_zip_read->pos_in_zipfile = 
            uf.cur_file_info_internal.offset_curfile + SIZEZIPLOCALHEADER + 
			  iSizeVar;
	
	uf.pfile_in_zip_read->stream.avail_in = (uInt)0;

}
/*
  Write info about the ZipFile in the *pglobal_info structure.
  No preparation of the structure is needed
*/
void CUnzipFile::GetGlobalInfo(unz_global_info &global_info)
{
	global_info = uf.gi;
}

void CUnzipFile::GetCurrentFileInfo ( unz_file_info* file_info,
                                         LPSTR szFileName,
										 uLong fileNameBufferSize,
										 void *extraField,
										 uLong extraFieldBufferSize,
										 LPSTR szComment,
										 uLong commentBufferSize)
{

	
	unz_file_info temp;
	if (!file_info)
		file_info = &temp;

	unz_file_info_internal temp1;
	unzlocal_GetCurrentFileInfoInternal(*file_info, temp1, szFileName, fileNameBufferSize,
		extraField, extraFieldBufferSize, szComment, commentBufferSize);
}



/*
  Read bytes from the current file.
  buf contain buffer where data must be copied
  len the size of buf.

  return the number of byte copied if somes bytes are copied
  return 0 if the end of file was reached
*/
int CUnzipFile::ReadCurrentFile(void* buf, UINT len)
{

	if (!uf.pfile_in_zip_read)
		ThrowError(UNZ_PARAMERROR);

	if ((len == 0) || !buf)
		return 0;

	uf.pfile_in_zip_read->stream.next_out = (Bytef*)buf;
	uf.pfile_in_zip_read->stream.avail_out = (uInt)len;
	
	if (len > uf.pfile_in_zip_read->rest_read_uncompressed)
		uf.pfile_in_zip_read->stream.avail_out = 
		  (uInt)uf.pfile_in_zip_read->rest_read_uncompressed;


	uInt iRead = 0;

	while (uf.pfile_in_zip_read->stream.avail_out>0)
	{
		if ((uf.pfile_in_zip_read->stream.avail_in==0) &&
            (uf.pfile_in_zip_read->rest_read_compressed>0))
		{
			uInt uReadThis = UNZ_BUFSIZE;
			if (uf.pfile_in_zip_read->rest_read_compressed<uReadThis)
				uReadThis = (uInt)uf.pfile_in_zip_read->rest_read_compressed;
			if (uReadThis == 0)
				return 0;


			uf.file.Seek(uf.pfile_in_zip_read->pos_in_zipfile + 
				uf.pfile_in_zip_read->byte_before_the_zipfile, CFile::begin);

			uf.file.Read(uf.pfile_in_zip_read->read_buffer, uReadThis);
			uf.pfile_in_zip_read->pos_in_zipfile += uReadThis;

			uf.pfile_in_zip_read->rest_read_compressed-=uReadThis;
			
			uf.pfile_in_zip_read->stream.next_in = 
                (Bytef*)uf.pfile_in_zip_read->read_buffer;
			uf.pfile_in_zip_read->stream.avail_in = (uInt)uReadThis;
		}

		if (uf.pfile_in_zip_read->compression_method==0)
		{
			uInt uDoCopy;
			if (uf.pfile_in_zip_read->stream.avail_out < 
                            uf.pfile_in_zip_read->stream.avail_in)
				uDoCopy = uf.pfile_in_zip_read->stream.avail_out ;
			else
				uDoCopy = uf.pfile_in_zip_read->stream.avail_in ;

			memcpy(uf.pfile_in_zip_read->stream.next_out, 
				uf.pfile_in_zip_read->stream.next_in, uDoCopy);
					
			uf.pfile_in_zip_read->crc32 = crc32(uf.pfile_in_zip_read->crc32,
								uf.pfile_in_zip_read->stream.next_out,

?? 快捷鍵說(shuō)明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
91麻豆蜜桃一区二区三区| 亚洲色图在线播放| 国产精品灌醉下药二区| 亚洲欧美偷拍另类a∨色屁股| 一区二区三区不卡在线观看| 首页国产欧美久久| 国内一区二区在线| 99久久免费视频.com| 欧美美女bb生活片| 精品盗摄一区二区三区| 亚洲免费观看高清完整版在线| 偷偷要91色婷婷| 风间由美一区二区三区在线观看 | 欧美精品一区男女天堂| 1024亚洲合集| 麻豆久久久久久| 97se亚洲国产综合在线| 欧美一区二区精美| 亚洲欧洲一区二区三区| 麻豆精品一区二区三区| 91蝌蚪porny九色| 精品免费国产二区三区| 一区二区三区日韩欧美| 国产一区二区三区四区五区入口| 欧美在线免费播放| 国产欧美日产一区| 首页欧美精品中文字幕| 91麻豆免费观看| 国产亚洲午夜高清国产拍精品| 亚洲aⅴ怡春院| 岛国一区二区在线观看| 欧美一区二区在线视频| 国产精品黄色在线观看| 久久aⅴ国产欧美74aaa| 欧美性猛交xxxxxx富婆| 日本一区二区视频在线观看| 日本伊人精品一区二区三区观看方式| bt欧美亚洲午夜电影天堂| 精品久久人人做人人爽| 香蕉成人伊视频在线观看| 成人18视频在线播放| 2023国产精华国产精品| 午夜精品久久一牛影视| 色综合天天综合狠狠| 国产午夜亚洲精品不卡| 免费在线成人网| 欧美日韩一区二区在线观看视频 | www.在线欧美| 国产欧美一区二区三区网站| 免费人成精品欧美精品| 欧美三级中文字| 亚洲日本电影在线| 成人动漫中文字幕| 亚洲va欧美va人人爽| 91视频免费看| 国产精品久久久一本精品| 国产久卡久卡久卡久卡视频精品| 337p亚洲精品色噜噜狠狠| 亚洲国产wwwccc36天堂| 91久久国产最好的精华液| 亚洲欧洲精品一区二区三区不卡| 国产69精品久久99不卡| 久久久久久久性| 国产一区二区三区香蕉 | 国产激情一区二区三区| 精品国产1区2区3区| 日韩激情一二三区| 欧美高清www午色夜在线视频| 亚洲最色的网站| 欧美无砖专区一中文字| 亚洲一区视频在线| 欧美色视频在线观看| 亚洲国产欧美在线| 欧美三级一区二区| 日韩精品电影在线观看| 91麻豆精品国产91久久久更新时间| 午夜精品在线看| 欧美日韩在线免费视频| 爽好久久久欧美精品| 日韩一级完整毛片| 久久99精品久久久| 久久亚区不卡日本| 国产成人在线免费| 国产精品国产三级国产普通话三级 | 色噜噜夜夜夜综合网| 一区二区三区美女视频| 欧美日韩三级在线| 日本色综合中文字幕| 精品国产一区二区三区久久久蜜月 | 欧美日本一区二区在线观看| 日本va欧美va精品发布| 精品国产免费视频| 国产激情精品久久久第一区二区| 欧美国产精品v| 色天使色偷偷av一区二区| 亚洲一区二区不卡免费| 欧美肥妇free| 国产米奇在线777精品观看| 国产清纯美女被跳蛋高潮一区二区久久w| 成人少妇影院yyyy| 亚洲综合久久久| 日韩欧美一级特黄在线播放| 国产乱人伦偷精品视频免下载 | 色综合中文字幕国产| 亚洲国产精品一区二区久久| 日韩一区二区三区精品视频| 国产精品综合久久| 亚洲免费在线播放| 日韩欧美一二三区| 99久久久国产精品| 日韩av一级片| 国产欧美一二三区| 欧美三级电影在线观看| 国产在线麻豆精品观看| 亚洲欧美日韩综合aⅴ视频| 91精品国产欧美一区二区成人| 国产精品 欧美精品| 一区二区三区日韩欧美| 久久综合999| 91成人国产精品| 久久99深爱久久99精品| 一区二区三区产品免费精品久久75| 欧美不卡一区二区| 91麻豆精品秘密| 狠狠色综合日日| 夜色激情一区二区| 久久婷婷久久一区二区三区| 在线亚洲一区二区| 国产精品一区二区在线观看不卡| 一区二区三区中文字幕精品精品| 精品久久久久久久久久久久包黑料 | 久久综合99re88久久爱| 欧美亚洲综合网| 国产成人精品免费视频网站| 午夜精品在线看| 中文字幕在线播放不卡一区| 日韩欧美你懂的| 日本精品免费观看高清观看| 国产自产v一区二区三区c| 亚洲小少妇裸体bbw| 欧美国产激情一区二区三区蜜月| 欧美日韩精品免费观看视频| 成人av网站免费| 久久国产精品99精品国产| 亚洲一区二区三区不卡国产欧美| 久久久99久久精品欧美| 欧美精品三级在线观看| 一本色道综合亚洲| 国产成人av在线影院| 麻豆成人在线观看| 亚洲永久精品国产| 国产精品家庭影院| 国产欧美日韩激情| 精品成人a区在线观看| 欧美精品色一区二区三区| 色94色欧美sute亚洲线路二| 成人激情免费视频| 国产一区二区三区国产| 麻豆精品在线视频| 丝袜诱惑制服诱惑色一区在线观看| 亚洲啪啪综合av一区二区三区| 国产欧美精品一区二区三区四区 | 高清不卡在线观看| 久草热8精品视频在线观看| 无码av免费一区二区三区试看| 一区二区三区高清不卡| 亚洲精品国产一区二区精华液| 国产农村妇女毛片精品久久麻豆 | 亚洲国产综合91精品麻豆| 国产性天天综合网| 精品日韩欧美在线| 日韩欧美国产综合在线一区二区三区| 欧美日韩国产免费| 欧美三级日韩在线| 欧美系列在线观看| 在线观看中文字幕不卡| 在线免费不卡电影| 在线精品视频免费观看| 日本道精品一区二区三区| 色综合久久综合中文综合网| 91在线码无精品| 99精品一区二区| 91欧美一区二区| 色综合久久综合| 欧美亚洲一区三区| 精品1区2区3区| 337p亚洲精品色噜噜| 日韩免费电影一区| 精品国产麻豆免费人成网站| 久久综合色播五月| 国产欧美精品一区二区色综合朱莉 | 麻豆91免费看| 裸体在线国模精品偷拍| 国产综合久久久久影院| 国产麻豆精品视频| 国产不卡在线一区| 波多野结衣91| 在线中文字幕不卡| 欧美狂野另类xxxxoooo| 日韩区在线观看|