您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch | 异常检测 | Transformers | 情感分类 | 知识图谱 |

自学教程:C++ unzGoToNextFile函数代码示例

51自学网 2021-06-03 09:12:34
  C++
这篇教程C++ unzGoToNextFile函数代码示例写得很实用,希望能帮到您。

本文整理汇总了C++中unzGoToNextFile函数的典型用法代码示例。如果您正苦于以下问题:C++ unzGoToNextFile函数的具体用法?C++ unzGoToNextFile怎么用?C++ unzGoToNextFile使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。

在下文中一共展示了unzGoToNextFile函数的28个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: unzLocateFile

/*  Try locate the file szFileName in the zipfile.  For the iCaseSensitivity signification, see unzipStringFileNameCompare  return value :  UNZ_OK if the file is found. It becomes the current file.  UNZ_END_OF_LIST_OF_FILE if the file is not found*/extern int ZEXPORTunzLocateFile(unzFile file,const char *szFileName,              int iCaseSensitivity,int iIgnorePaths,              char *actual_filename){  unz_s		*s;  int		err,match_ok,n,patlen;  const char	*p1,*p2;  uLong		num_fileSaved;  uLong		pos_in_central_dirSaved;  char		szCurrentFileName[UNZ_MAXFILENAMEINZIP+1];  if (file==NULL) return UNZ_PARAMERROR;  if (strlen(szFileName)>=UNZ_MAXFILENAMEINZIP) return UNZ_PARAMERROR;  p1 = (iIgnorePaths) ? basename(szFileName) : szFileName;  patlen = (*p1=='*') ? strlen(p1)-1 : 0;  s = (unz_s*) file;  if (!s->current_file_ok) return UNZ_END_OF_LIST_OF_FILE;  num_fileSaved = s->num_file;  pos_in_central_dirSaved = s->pos_in_central_dir;  err = unzGoToFirstFile(file);  while (err == UNZ_OK)    {      unzGetCurrentFileInfo(file,NULL,szCurrentFileName,                            sizeof(szCurrentFileName)-1,NULL,0,NULL,0);      p2 = (iIgnorePaths) ? basename(szCurrentFileName) : szCurrentFileName;      if (patlen>0)        {          n = strlen(p2);          match_ok = (n>patlen && lstrcmpi(p2+n-patlen,p1+1)==0);        }      else        match_ok = (unzStringFileNameCompare(p2,p1,iCaseSensitivity)==0);      if (match_ok)        {          if (actual_filename) strcpy(actual_filename,szCurrentFileName);          return UNZ_OK;        }      err = unzGoToNextFile(file);    }  s->num_file = num_fileSaved ;  s->pos_in_central_dir = pos_in_central_dirSaved ;  return err;}
开发者ID:WChrisK,项目名称:Zandronum,代码行数:57,


示例2: vfsInitPakFile

static void vfsInitPakFile(const char *filename){	unz_global_info gi;	unzFile         uf;	guint32         i;	int             err;	uf = unzOpen(filename);	if(uf == NULL)		return;	g_unzFiles = g_slist_append(g_unzFiles, uf);	err = unzGetGlobalInfo(uf, &gi);	if(err != UNZ_OK)		return;	unzGoToFirstFile(uf);	Sys_Printf("VFS Init: %s (pk3)/n", filename);	for(i = 0; i < gi.number_entry; i++)	{		char            filename_inzip[NAME_MAX];		unz_file_info   file_info;		VFS_PAKFILE    *file;		err = unzGetCurrentFileInfo(uf, &file_info, filename_inzip, sizeof(filename_inzip), NULL, 0, NULL, 0);		if(err != UNZ_OK)			break;		file = (VFS_PAKFILE *) safe_malloc(sizeof(VFS_PAKFILE));		g_pakFiles = g_slist_append(g_pakFiles, file);		vfsFixDOSName(filename_inzip);		g_strdown(filename_inzip);		file->name = strdup(filename_inzip);		file->size = file_info.uncompressed_size;		file->zipfile = uf;		memcpy(&file->zipinfo, uf, sizeof(unz_s));		if((i + 1) < gi.number_entry)		{			err = unzGoToNextFile(uf);			if(err != UNZ_OK)				break;		}	}}
开发者ID:joseprous,项目名称:xmap,代码行数:49,


示例3:

		void					UnzipBase::getAllFilenames(vector<wcs>& array_filename) const		{			if(!_handle)				return;			int ret;			for(ret=unzGoToFirstFile(_handle);ret==UNZ_OK;ret=unzGoToNextFile(_handle))			{				char filename[4096];				if(unzGetCurrentFileInfo(_handle,0,filename,(unsigned long)sizeof(filename),0,0,0,0)!=UNZ_OK)					continue;				filename[4095]=0;				array_filename.push_back(MBSTOWCS(filename));			}		}
开发者ID:vinceplusplus,项目名称:z3D,代码行数:15,


示例4: R_unzGoToNextFile

SEXPR_unzGoToNextFile(SEXP r_r274){    SEXP r_ans = R_NilValue;   unzFile r274 ;int ans ;    r274  =  DEREF_REF_PTR_CLASS( r_r274 ,  unzFile, unzContent ) ;    ans =   unzGoToNextFile ( r274 ) ;    r_ans =  ScalarInteger( ans ) ;    return(r_ans);}
开发者ID:johndharrison,项目名称:Rcompression,代码行数:15,


示例5: UnzipGetData

int UnzipGetData( void *zFile, unsigned char *buffer, size_t bytestoread ){	int zStatus;	zStatus = unzReadCurrentFile( zFile , buffer, bytestoread );	if ( zStatus <= 0 )	{		unzCloseCurrentFile( zFile );		if ( unzGoToNextFile( zFile ) == UNZ_OK )		{			if ( unzOpenCurrentFile( zFile ) == UNZ_OK )				zStatus = UnzipGetData( zFile, buffer, bytestoread );		}	}	return zStatus;}
开发者ID:rauls,项目名称:iReporter,代码行数:15,


示例6: ClearList

bool ZipFile::LoadList(){    ClearList();    if(!SwitchMode(ZipFile::OPEN))        return false;    int ret = unzGoToFirstFile(uzFile);    if(ret != UNZ_OK)        return false;    char filename[1024];    unz_file_info cur_file_info;    RealArchiveItemCount = 0;    do    {        if(unzGetCurrentFileInfo(uzFile, &cur_file_info, filename, sizeof(filename), NULL, 0, NULL, 0) == UNZ_OK)        {            bool isDir = false;            if(filename[strlen(filename)-1] == '/')            {                isDir = true;                filename[strlen(filename)-1] = '/0';            }            int strlength = strlen(filename)+1;            ArchiveFileStruct * CurArcFile = new ArchiveFileStruct;            CurArcFile->filename = new char[strlength];            strcpy(CurArcFile->filename, filename);            CurArcFile->length = cur_file_info.uncompressed_size;            CurArcFile->comp_length = cur_file_info.compressed_size;            CurArcFile->isdir = isDir;            CurArcFile->fileindex = RealArchiveItemCount;            CurArcFile->ModTime = (u64) cur_file_info.dosDate;            CurArcFile->archiveType = ZIP;            ZipStructure.push_back(CurArcFile);        }        ++RealArchiveItemCount;    }    while(unzGoToNextFile(uzFile) == UNZ_OK);    PathControl();    return true;}
开发者ID:Gamer125,项目名称:wiibrowser,代码行数:48,


示例7: result

/*!/brief Gets a list of files stored in the zip archive./param[out] container StringContainer used to store the list of file in the zip archive./return Returns dmz::True if the container was successfully populated. Returnsdmz::False if there is no open zip archive open.*/dmz::Booleandmz::ReaderZip::get_file_list (StringContainer &container) const {   Boolean result (False);   if (_state.zf) {      result = True;      int value = unzGoToFirstFile (_state.zf);      while (result && (UNZ_OK == value)) {         unz_file_info info;         const int Found = unzGetCurrentFileInfo (_state.zf, &info, 0, 0, 0, 0, 0, 0);         if (Found == UNZ_OK && (info.size_filename > 0)) {            char *buffer = new char[info.size_filename + 1];            if (buffer) {               buffer[0] = '/0';               if (UNZ_OK == unzGetCurrentFileInfo (                     _state.zf,                     0, // info struct                     buffer, info.size_filename,                     0, 0, // extra field                     0, 0)) { // comment field                  buffer[info.size_filename] = '/0';                  container.add (buffer);               }               delete []buffer; buffer = 0;            }         }         else { result = _state.zip_error (Found); }         value = unzGoToNextFile (_state.zf);      }   }   return result;}
开发者ID:ben-sangster,项目名称:dmz,代码行数:56,


示例8: _vdzListNext

struct VDirEntry* _vdzListNext(struct VDir* vd) {	struct VDirZip* vdz = (struct VDirZip*) vd;	if (!vdz->hasNextFile) {		return 0;	}	unz_file_info64 info;	int status = unzGetCurrentFileInfo64(vdz->z, &info, vdz->dirent.name, sizeof(vdz->dirent.name), 0, 0, 0, 0);	if (status < 0) {		return 0;	}	vdz->dirent.fileSize = info.uncompressed_size;	if (unzGoToNextFile(vdz->z) == UNZ_END_OF_LIST_OF_FILE) {		vdz->hasNextFile = false;	}	return &vdz->dirent.d;}
开发者ID:nagitsu,项目名称:mgba,代码行数:16,


示例9: MFFileZipFile_FindNext

bool MFFileZipFile_FindNext(MFFind *pFind, MFFindData *pFindData){	unzFile zipFile = (unzFile)pFind->pMount->pFilesysData;	int err = unzGoToNextFile(zipFile);	if(err != UNZ_OK)		return false;	unz_file_info fileInfo;	unzGetCurrentFileInfo(zipFile, &fileInfo, pFindData->pFilename, sizeof(pFindData->pFilename), NULL, 0, NULL, 0);	pFindData->attributes = 0;	pFindData->fileSize = fileInfo.uncompressed_size;	return true;}
开发者ID:RemedyGameJam,项目名称:fuji,代码行数:16,


示例10: zip_findnext

int zip_findnext(struct zip_find_t *file){	if (zipfile && zip_mode == ZIP_READOPEN)	{		if (unzGoToNextFile(zipfile) == UNZ_OK)		{			unz_file_info info;			unzGetCurrentFileInfo(zipfile, &info, file->name, MAX_PATH, NULL, 0, NULL, 0);			file->length = info.uncompressed_size;			file->crc32 = info.crc;			return 1;		}	}	return 0;}
开发者ID:AMSMM,项目名称:NJEMU,代码行数:16,


示例11: zipGetFileList

/********************************************************************************* Description***     Creates a list of file names inside a zip that matches a given***     extension.****** Arguments***     zipName     - Name of zip file***     ext         - Extension to check***     count       - Output for number of matching files in zip file.****** Return***     1 if files with the given extension exists in the zip file,***     0 otherwise.***********************************************************************************/char* zipGetFileList(const char* zipName, const char* ext, int* count) {    char tempName[256];    char extension[8];    unzFile zip;    unz_file_info info;    char* fileArray = NULL;    int totalLen = 0;    int status;    *count = 0;    zip = unzOpen(zipName);    if (!zip) {        return 0;    }    strcpy(extension, ext);    toLower(extension);    status = unzGoToFirstFile(zip);    unzGetCurrentFileInfo(zip,&info,tempName,256,NULL,0,NULL,0);    while (status == UNZ_OK) {        char tmp[256];        unzGetCurrentFileInfo(zip, &info, tempName, 256, NULL, 0, NULL, 0);        strcpy(tmp, tempName);        toLower(tmp);        if (strstr(tmp, extension) != NULL) {            int entryLen = strlen(tempName) + 1;            fileArray = realloc(fileArray, totalLen +  entryLen + 1);            strcpy(fileArray + totalLen, tempName);            totalLen += entryLen;            fileArray[totalLen] = '/0'; // double null termination at end            *count = *count + 1;        }        status = unzGoToNextFile(zip);    }    unzClose(zip);    return fileArray;}
开发者ID:meesokim,项目名称:bluemsx-wii,代码行数:63,


示例12: next

//---------------------------------------------------------------------------bool zipclass::next(){  if (enable_zip==0) return ZIPPY_FAIL;  if (strcmp(type,"ZIP")==0){#ifdef UNIX    if (is_open==0) return ZIPPY_FAIL;  	if (current_file_n>=(int)(gi.number_entry-1)) return ZIPPY_FAIL;    err=unzGoToNextFile(uf);    if (err) return ZIPPY_FAIL;    err=unzGetCurrentFileInfo(uf,&fi,filename_inzip,          sizeof(filename_inzip),NULL,0,NULL,0);    if (err) return ZIPPY_FAIL;    current_file_n++;    current_file_offset=current_file_n;    crc=fi.crc;#endif#ifdef WIN32    err=GetNextInZip(&PackInfo);    if (err!=UNZIP_Ok) return ZIPPY_FAIL;    attrib=PackInfo.Attr;    crc=PackInfo.Crc;    current_file_n++;    current_file_offset=PackInfo.HeaderOffset;#endif    return ZIPPY_SUCCEED;#ifdef RAR_SUPPORT  }else if (strcmp(type,"RAR")==0){    if (is_open==0 || rar_current==NULL) return ZIPPY_FAIL;    do{      rar_current=rar_current->next;      current_file_n++;      if (rar_current==NULL) return ZIPPY_FAIL;    }while (rar_current->item.FileAttr & 0x10); // Skip if directory    current_file_offset=current_file_n;    attrib=WORD(rar_current->item.FileAttr);    crc=rar_current->item.FileCRC;    return ZIPPY_SUCCEED;#endif  }  return ZIPPY_FAIL;}
开发者ID:gbouthenot,项目名称:Steem-Engine,代码行数:48,


示例13: loadZipFile2

void loadZipFile2(const char* ipsw, OutputState** output, const char* file, int useMemory) {	char* fileName;	void* buffer;	unzFile zip;	unz_file_info pfile_info;	ASSERT(zip = unzOpen(ipsw), "cannot open input ipsw");	ASSERT(unzGoToFirstFile(zip) == UNZ_OK, "cannot seek to first file in input ipsw");	do {		ASSERT(unzGetCurrentFileInfo(zip, &pfile_info, NULL, 0, NULL, 0, NULL, 0) == UNZ_OK, "cannot get current file info from ipsw");		fileName = (char*) malloc(pfile_info.size_filename + 1);		ASSERT(unzGetCurrentFileInfo(zip, NULL, fileName, pfile_info.size_filename + 1, NULL, 0, NULL, 0) == UNZ_OK, "cannot get current file name from ipsw");		if((file == NULL && fileName[strlen(fileName) - 1] != '/') || (file != NULL && strcmp(fileName, file)) == 0) {			printf("loading: %s (%ld)/n", fileName, pfile_info.uncompressed_size); fflush(stdout);			ASSERT(unzOpenCurrentFile(zip) == UNZ_OK, "cannot open compressed file in IPSW");			if(useMemory) {				buffer = malloc((pfile_info.uncompressed_size > 0) ? pfile_info.uncompressed_size : 1);				ASSERT(unzReadCurrentFile(zip, buffer, pfile_info.uncompressed_size) == pfile_info.uncompressed_size, "cannot read file from ipsw");				addToOutput(output, fileName, buffer, pfile_info.uncompressed_size);			} else {				char* tmpFileName = createTempFile();				FILE* tmpFile = fopen(tmpFileName, "wb");				buffer = malloc(DEFAULT_BUFFER_SIZE);				size_t left = pfile_info.uncompressed_size;				while(left > 0) {					size_t toRead;					if(left > DEFAULT_BUFFER_SIZE)						toRead = DEFAULT_BUFFER_SIZE;					else						toRead = left;					ASSERT(unzReadCurrentFile(zip, buffer, toRead) == toRead, "cannot read file from ipsw");					fwrite(buffer, toRead, 1, tmpFile);					left -= toRead;				}				fclose(tmpFile);				free(buffer);				addToOutput2(output, fileName, NULL, pfile_info.uncompressed_size, tmpFileName);			}			ASSERT(unzCloseCurrentFile(zip) == UNZ_OK, "cannot close compressed file in IPSW");		}		free(fileName);	} while(unzGoToNextFile(zip) == UNZ_OK);	ASSERT(unzClose(zip) == UNZ_OK, "cannot close input ipsw file");}
开发者ID:archoner,项目名称:xpwn,代码行数:46,


示例14: unzOpen2_64

	void ZipFile::init()	{		zlib_filefunc64_def file_functions;		unz_file_info64 info;		unz64_file_pos position;		boost::scoped_array<char> file_name;		String index;		Uint32 size;		Sint32 ok;		file_functions.zopen64_file = open_ifstream_func;		file_functions.zread_file = read_istream_func;		file_functions.zwrite_file = write_istream_func;		file_functions.ztell64_file = tell_istream_func;		file_functions.zseek64_file = seek_istream_func;		file_functions.zclose_file = close_istream_func;		file_functions.zerror_file = error_istream_func;		m_file = unzOpen2_64(utf8_to_string(get_name()).c_str(),			&file_functions);		ok = unzGoToFirstFile(m_file);		while (ok == UNZ_OK)		{			unzGetFilePos64(m_file, &position);			unzGetCurrentFileInfo64(m_file, &info, 0, 0, 0, 0, 0,				0);			size = info.size_filename;			file_name.reset(new char[size + 1]);			unzGetCurrentFileInfo64(m_file, 0, file_name.get(),				size, 0, 0, 0, 0);			index = String(string_to_utf8(std::string(				file_name.get(), size)));			m_files[index] = ZipFileEntry(position);			ok = unzGoToNextFile(m_file);		}	}
开发者ID:xaphier,项目名称:Eternal-Lands,代码行数:45,


示例15: unzOpen2

gbooleanManagedUnzip::StreamToStreamNthFile (ManagedStreamCallbacks *source, ManagedStreamCallbacks *dest, int file){	zlib_filefunc_def funcs;	unzFile zipFile;	gboolean ret;	ret = FALSE;	funcs.zopen_file = managed_stream_open;	funcs.zread_file = managed_stream_read;	funcs.zwrite_file = managed_stream_write;	funcs.ztell_file = managed_stream_tell;	funcs.zseek_file = managed_stream_seek;	funcs.zclose_file = managed_stream_close;	funcs.zerror_file = managed_stream_error;	funcs.opaque = source;	zipFile = unzOpen2 (NULL, &funcs);	if (!zipFile)		return FALSE;	if (unzGoToFirstFile (zipFile) != UNZ_OK)		goto cleanup;	while (!IsCurrentFileValid (zipFile) || file > 0) {		if (unzGoToNextFile (zipFile) != UNZ_OK)			goto cleanup;		if (!IsCurrentFileValid (zipFile))			continue;		file --;	}	if (unzOpenCurrentFile (zipFile) != UNZ_OK)		goto cleanup;	ret = ExtractToStream (zipFile, dest);cleanup:	unzCloseCurrentFile (zipFile);	unzClose (zipFile);	return ret;}
开发者ID:499940913,项目名称:moon,代码行数:45,


示例16: unzGoToFirstFile

int ZipArchive::listMembers(ArchiveMemberList &list) {	int matches = 0;	int err = unzGoToFirstFile(_zipFile);	while (err == UNZ_OK) {		char szCurrentFileName[UNZ_MAXFILENAMEINZIP+1];		if (unzGetCurrentFileInfo(_zipFile, NULL,		                          szCurrentFileName, sizeof(szCurrentFileName)-1,		                          NULL, 0, NULL, 0) == UNZ_OK) {			list.push_back(ArchiveMemberList::value_type(new GenericArchiveMember(szCurrentFileName, this)));			matches++;		}		err = unzGoToNextFile(_zipFile);	}	return matches;}
开发者ID:AdamRi,项目名称:scummvm-pink,代码行数:18,


示例17: unzip_mem

void unzip_mem(char* buf, int len, TCHAR* dest){	zlib_filefunc64_def ffunc;	fill_memory_filefunc64(&ffunc);	char zipfile[128];	mir_snprintf(zipfile, sizeof(zipfile), "%p+%x", buf, len);	unzFile uf = unzOpen2_64(zipfile, &ffunc);	if (uf)	{		do {			extractCurrentFile(uf, dest);		}		while (unzGoToNextFile(uf) == UNZ_OK);		unzClose(uf);	}}
开发者ID:TonyAlloa,项目名称:miranda-dev,代码行数:18,


示例18: fill_functions

bool ArchiveReader::Enumerate_ZIP(){	clPtr<iIStream> TheSource = FSourceFile;	FSourceFile->Seek( 0 );	zlib_filefunc64_def ffunc;	fill_functions( TheSource.GetInternalPtr(), &ffunc );	unzFile uf = unzOpen2_64( "", &ffunc );	unz_global_info64 gi;	int err = unzGetGlobalInfo64( uf, &gi );	for ( uLong i = 0; i < gi.number_entry; i++ )	{		char filename_inzip[256];		unz_file_info64 file_info;		err = unzGetCurrentFileInfo64( uf, &file_info, filename_inzip, sizeof( filename_inzip ), NULL, 0, NULL, 0 );		if ( err != UNZ_OK ) { break; }		if ( ( i + 1 ) < gi.number_entry )		{			err = unzGoToNextFile( uf );			// WARNING: "error %d with zipfile in unzGoToNextFile/n", err			if ( err != UNZ_OK ) { break; }		}		sFileInfo Info;		Info.FOffset = 0;		Info.FCompressedSize = file_info.compressed_size;		Info.FSize = file_info.uncompressed_size;		FFileInfos.push_back( Info );		std::string TheName = Arch_FixFileName( filename_inzip );		FFileInfoIdx[TheName] = ( int )FFileNames.size();		FFileNames.push_back( TheName );		FRealFileNames.push_back( std::string( filename_inzip ) );	}	unzClose( uf );	return true;}
开发者ID:BlastarIndia,项目名称:Android-NDK-Game-Development-Cookbook,代码行数:44,


示例19: unzLocateFile

/*  Try locate the file szFileName in the zipfile.  For the iCaseSensitivity signification, see unzipStringFileNameCompare  return value :  UNZ_OK if the file is found. It becomes the current file.  UNZ_END_OF_LIST_OF_FILE if the file is not found*/extern int ZEXPORT unzLocateFile(	unzFile file,	const char *szFileName,	int iCaseSensitivity ){	unz_s* s;		int err;		uLong num_fileSaved;	uLong pos_in_central_dirSaved;	if (file==NULL)		return UNZ_PARAMERROR;    if (strlen(szFileName)>=UNZ_MAXFILENAMEINZIP)        return UNZ_PARAMERROR;	s=(unz_s*)file;	if (!s->current_file_ok)		return UNZ_END_OF_LIST_OF_FILE;	num_fileSaved = s->num_file;	pos_in_central_dirSaved = s->pos_in_central_dir;	err = unzGoToFirstFile(file);	while (err == UNZ_OK)	{		char szCurrentFileName[UNZ_MAXFILENAMEINZIP+1];		unzGetCurrentFileInfo(file,NULL,								szCurrentFileName,sizeof(szCurrentFileName)-1,								NULL,0,NULL,0);		if (unzStringFileNameCompare(szCurrentFileName,										szFileName,iCaseSensitivity)==0)			return UNZ_OK;		err = unzGoToNextFile(file);	}	s->num_file = num_fileSaved ;	s->pos_in_central_dir = pos_in_central_dirSaved ;	return err;}
开发者ID:Miinky-EmuDev,项目名称:gens-rerecording,代码行数:52,


示例20: unzGetGlobalInfo

std::vector<std::string> FileSystemZip::GetContents(){	uLong			i;	unz_global_info gi;	int				err;	char			filename_inzip[512];	unz_file_info	file_info;		std::vector<std::string> contents;	err = unzGetGlobalInfo(m_unzf,&gi);	if (err!=UNZ_OK)	{		LogError("error %d with zipfile in unzGetGlobalInfo /n",err);		return contents;	}	unzGoToFirstFile(m_unzf);	for (i=0;i<gi.number_entry;i++)	{		err = unzGetCurrentFileInfo(m_unzf,&file_info,filename_inzip,sizeof(filename_inzip),NULL,0,NULL,0);				if (err!=UNZ_OK)		{			LogError("error %d with zipfile in unzGetCurrentFileInfo/n",err);			break;		}		contents.push_back(std::string(filename_inzip));		if ((i+1)<gi.number_entry)		{			err = unzGoToNextFile(m_unzf);			if (err!=UNZ_OK)			{				LogError("error %d with zipfile in unzGoToNextFile/n",err);				break;			}		}	}	return contents;}
开发者ID:fatalfeel,项目名称:proton_sdk_source,代码行数:44,


示例21: ReadZipFileAux

static status_t ReadZipFileAux(zipFile zf, Message & msg, char * nameBuf, uint32 nameBufLen, bool loadData){   while(unzOpenCurrentFile(zf) == UNZ_OK)   {      unz_file_info fileInfo;      if (unzGetCurrentFileInfo(zf, &fileInfo, nameBuf, nameBufLen, NULL, 0, NULL, 0) != UNZ_OK) return B_ERROR;      // Add the new entry to the appropriate spot in the tree (demand-allocate sub-Messages as necessary)      {         const char * nulByte = strchr(nameBuf, '/0');         const bool isFolder = ((nulByte > nameBuf)&&(*(nulByte-1) == '/'));         Message * m = &msg;         StringTokenizer tok(true, nameBuf, "/");         const char * nextTok;         while((nextTok = tok()) != NULL)         {            String fn(nextTok);            if ((isFolder)||(tok.GetRemainderOfString()))            {               // Demand-allocate a sub-message               MessageRef subMsg;               if (m->FindMessage(fn, subMsg) != B_NO_ERROR)                {                  if ((m->AddMessage(fn, Message()) != B_NO_ERROR)||(m->FindMessage(fn, subMsg) != B_NO_ERROR)) return B_ERROR;               }               m = subMsg();            }            else            {               if (loadData)               {                  ByteBufferRef bufRef = GetByteBufferFromPool((uint32) fileInfo.uncompressed_size);                  if ((bufRef() == NULL)||(unzReadCurrentFile(zf, bufRef()->GetBuffer(), bufRef()->GetNumBytes()) != (int32)bufRef()->GetNumBytes())||(m->AddFlat(fn, bufRef) != B_NO_ERROR)) return B_ERROR;               }               else if (m->AddInt64(fn, fileInfo.uncompressed_size) != B_NO_ERROR) return B_ERROR;            }         }      }      if (unzCloseCurrentFile(zf) != UNZ_OK) return B_ERROR;      if (unzGoToNextFile(zf) != UNZ_OK) break;   }   return B_NO_ERROR;}
开发者ID:jfriesne,项目名称:muscle,代码行数:43,


示例22: unzip

bool unzip(const TCHAR *ptszZipFile, TCHAR *ptszDestPath, TCHAR *ptszBackPath,bool ch){	bool bResult = true;	zlib_filefunc64_def ffunc;	fill_fopen64_filefunc(&ffunc);		unzFile uf = unzOpen2_64(ptszZipFile, &ffunc);	if (uf) {		do {			if (!extractCurrentFile(uf, ptszDestPath, ptszBackPath,ch))				bResult = false;		}			while (unzGoToNextFile(uf) == UNZ_OK);		unzClose(uf);	}	return bResult;}
开发者ID:0xmono,项目名称:miranda-ng,代码行数:19,


示例23: unzClose

int UnzipCache::unzip(const char *pattern, std::list<clc::Buffer> *matchedNames){    uLong i;    unz_global_info64 gi;    int numMatched = 0;    if (m_uf)        unzClose(m_uf);    m_uf = unzOpen64(m_filename.c_str());    int err = unzGetGlobalInfo64(m_uf, &gi);    if (err != UNZ_OK) {        clc::Log::error("ocher.epub.unzip", "unzGetGlobalInfo: %d", err);        return -1;    }    for (i = 0; i < gi.number_entry; i++) {        int r;        if (matchedNames) {            clc::Buffer matchedName;            r = unzipFile(pattern, &matchedName);            if (!matchedName.empty())                matchedNames->push_back(matchedName);        } else {            r = unzipFile(pattern, NULL);        }        if (r > 0) {            ++numMatched;            if (r > 1)                break;        }        if ((i + 1) < gi.number_entry) {            err = unzGoToNextFile(m_uf);            if (err != UNZ_OK) {                clc::Log::error("ocher.epub.unzip", "unzGoToNextFile: %d", err);                return -1;            }        }    }    return numMatched;}
开发者ID:Kazunekit,项目名称:OcherBook,代码行数:42,


示例24: Open

bool eFileTypeZIP::Open(unzFile h, char* name) const{	if(!h)		return false;	bool ok = false;	if(unzGoToFirstFile(h) == UNZ_OK)	{		for(;;)		{			if(OpenCurrent(h, name))			{				ok = true;				break;			}			if(unzGoToNextFile(h) == UNZ_END_OF_LIST_OF_FILE)				break;		}	}	unzClose(h);	return ok;}
开发者ID:djdron,项目名称:UnrealSpeccyP,代码行数:21,


示例25: unzGoToFirstFile

  std::vector<openstudio::path> UnzipFile::listFiles() const  {    bool cont = unzGoToFirstFile(m_unzFile) == UNZ_OK;    std::vector<openstudio::path> paths;    do {      unz_file_info file_info;      std::vector<char> filename(300);      unzGetCurrentFileInfo(m_unzFile, &file_info,          &filename.front(), filename.size(),          nullptr,0,          nullptr,0);      paths.push_back(openstudio::toPath(std::string(&filename.front(), file_info.size_filename)));      cont = unzGoToNextFile(m_unzFile) == UNZ_OK;    } while (cont);    return paths;  }
开发者ID:Anto-F,项目名称:OpenStudio,代码行数:21,


示例26: unzGetCurrentFileInfo

void Unzip::retrieveAllFileInfos(void){	do{		unz_file_pos pos;		if(UNZ_OK != unzGetFilePos(zipfile_handle, &pos)){			continue;		}		unz_file_info info;		char currentFileName[CPPZIP_UNZIP_CHAR_ARRAY_BUFFER_SIZE];		char currentExtraField[CPPZIP_UNZIP_CHAR_ARRAY_BUFFER_SIZE];		char currentComment[CPPZIP_UNZIP_CHAR_ARRAY_BUFFER_SIZE];		unzGetCurrentFileInfo(zipfile_handle, &info,				currentFileName, CPPZIP_UNZIP_CHAR_ARRAY_BUFFER_SIZE,				currentExtraField, CPPZIP_UNZIP_CHAR_ARRAY_BUFFER_SIZE,				currentComment, CPPZIP_UNZIP_CHAR_ARRAY_BUFFER_SIZE);		std::shared_ptr<InnerZipFileInfo> innerFileInfo(new InnerZipFileInfo());		innerFileInfo->fileName = currentFileName;		innerFileInfo->extraField = currentExtraField;		innerFileInfo->comment = currentComment;		innerFileInfo->time_sec = info.tmu_date.tm_sec;		innerFileInfo->time_min = info.tmu_date.tm_min;		innerFileInfo->time_hour = info.tmu_date.tm_hour;		innerFileInfo->time_day_of_month = info.tmu_date.tm_mday;		innerFileInfo->time_month = info.tmu_date.tm_mon;		innerFileInfo->time_year = info.tmu_date.tm_year;		innerFileInfo->dosDate = info.dosDate;		innerFileInfo->crc = info.crc;		innerFileInfo->compressed_size = info.compressed_size;		innerFileInfo->uncompressed_size = info.uncompressed_size;		innerFileInfo->internal_fileAttributes = info.internal_fa;		innerFileInfo->external_fileAttributes = info.external_fa;		fileInfos.insert(std::make_pair(innerFileInfo->fileName, innerFileInfo));	} while(UNZ_OK == unzGoToNextFile(zipfile_handle));}
开发者ID:uboot,项目名称:CppZip,代码行数:40,


示例27: CArchiveBuffered

CArchiveZip::CArchiveZip(const std::string& name):	CArchiveBuffered(name),	curSearchHandle(1){#ifdef USEWIN32IOAPI	zlib_filefunc_def ffunc;	fill_win32_filefunc(&ffunc);	zip = unzOpen2(name.c_str(),&ffunc);#else	zip = unzOpen(name.c_str());#endif	if (!zip) {		LogObject() << "Error opening " << name;		return;	}	// We need to map file positions to speed up opening later	for (int ret = unzGoToFirstFile(zip); ret == UNZ_OK; ret = unzGoToNextFile(zip)) {		unz_file_info info;		char fname[512];		unzGetCurrentFileInfo(zip, &info, fname, 512, NULL, 0, NULL, 0);		const std::string name = StringToLower(fname);		if (name.empty()) {			continue;		}		const char last = name[name.length() - 1];		if ((last == '/') || (last == '//')) {			continue; // exclude directory names		}		FileData fd;		unzGetFilePos(zip, &fd.fp);		fd.size = info.uncompressed_size;		fd.origName = fname;		fd.crc = info.crc;		fileData[name] = fd;	}}
开发者ID:javaphoon,项目名称:spring,代码行数:40,


示例28: unzGoToFirstFile

bool ZipFile::SeekFile(int ind){    if(ind < 0 || ind >= (int) ZipStructure.size())        return false;    if(!SwitchMode(ZipFile::OPEN))        return false;    int ret = unzGoToFirstFile(uzFile);    if(ret != UNZ_OK)        return false;    while(ind > 0)    {        if(unzGoToNextFile(uzFile) != UNZ_OK)            return false;        --ind;    }    return true;}
开发者ID:Gamer125,项目名称:wiibrowser,代码行数:22,



注:本文中的unzGoToNextFile函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


C++ unzLocateFile函数代码示例
C++ unzGoToFirstFile函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。