这篇教程C++ unzGetGlobalInfo函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中unzGetGlobalInfo函数的典型用法代码示例。如果您正苦于以下问题:C++ unzGetGlobalInfo函数的具体用法?C++ unzGetGlobalInfo怎么用?C++ unzGetGlobalInfo使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了unzGetGlobalInfo函数的27个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: _wsreg_zlibais_openZlib_article_input_stream *_wsreg_zlibais_open(const char *filename){ Zlib_article_input_stream *ais = NULL; int result; String_util *sutil = _wsreg_strutil_initialize(); if (filename != NULL) { ais = zlibais_create(); ais->pdata->filename = sutil->clone(filename); ais->pdata->unzip_file = unzOpen(ais->pdata->filename); if (ais->pdata->unzip_file == NULL) { zlibais_free(ais); return (NULL); } result = unzGetGlobalInfo(ais->pdata->unzip_file, &ais->pdata->global_info); if (result != UNZ_OK) { unzCloseCurrentFile(ais->pdata->unzip_file); zlibais_free(ais); return (NULL); } } return (ais);}
开发者ID:belenix,项目名称:belenixold,代码行数:27,
示例2: zipExtractint zipExtract(unzFile uf, int overwrite, const char* password, ZIP_EXTRACT_CB progress_callback){ uLong i; unz_global_info gi; int err; err = unzGetGlobalInfo(uf,&gi); if (err!=UNZ_OK) { printf("error %d with zipfile in unzGetGlobalInfo /n",err); return 0; } for (i = 0; i < gi.number_entry; i++) { if( progress_callback ) { progress_callback(gi.number_entry, i); } if( !zipExtractCurrentfile(uf, overwrite, password) ) { return 0; } if ((i+1) < gi.number_entry) { err = unzGoToNextFile(uf); if (err!=UNZ_OK) { printf("error %d with zipfile in unzGoToNextFile/n",err); return 0; } } } return 1;}
开发者ID:CocoaMSX,项目名称:CocoaMSX,代码行数:34,
示例3: PackFileOpenint PackFileOpen (packfile_t *pf, const char *zname){ int x, max; unz_file_info file_info; strcpy (pf->pak_name, zname); pf->uf = unzOpen (pf->pak_name); if (!pf->uf) { return ERROR_PACK_FILE_NOT_EXIST; } unzGetGlobalInfo (pf->uf, &pf->gi); pf->fi = (fileinfo_t *)malloc (sizeof(fileinfo_t)*pf->gi.number_entry); if (!pf->fi) { unzClose (pf->uf); return ERROT_NOT_ENOUGHT_MEMORY; } max = pf->gi.number_entry; for (x=0; x<max; x++) { unzGetCurrentFileInfo (pf->uf,&file_info, pf->fi[x].name,sizeof(pf->fi[x].name),NULL,0,NULL,0); pf->fi[x].attr = file_info.external_fa; pf->fi[x].offset = file_info.offset; pf->fi[x].size = file_info.uncompressed_size; pf->fi[x].c_offset = file_info.c_offset; pf->fi[x].date = file_info.dosDate; _strlwr( pf->fi[x].name ); unzGoToNextFile (pf->uf); } return 1;}
开发者ID:gthgame,项目名称:gth,代码行数:35,
示例4: R_unzGetGlobalInfoSEXPR_unzGetGlobalInfo(SEXP r_file){ SEXP r_ans = R_NilValue;unz_global_info pglobal_info ; unzFile file ; int ans ; file = DEREF_REF_PTR_CLASS( r_file , unzFile, unzContent) ; ans = unzGetGlobalInfo ( file, & pglobal_info ) ; PROTECT(r_ans = NEW_LIST( 2 )); SET_VECTOR_ELT(r_ans, 0, ScalarInteger( ans ) ); SET_VECTOR_ELT( r_ans, 1 , R_copyStruct_unz_global_info( &pglobal_info ) ); { const char *names[] = { "", "pglobal_info" }; SET_NAMES(r_ans, R_makeNames(names, 2 )); }; UNPROTECT( 1 ); return(r_ans);}
开发者ID:johndharrison,项目名称:Rcompression,代码行数:26,
示例5: extractZipint extractZip(unzFile uf,int opt_extract_without_path,int opt_overwrite,const char* password){ uLong i; unz_global_info gi; int err; err = unzGetGlobalInfo (uf,&gi); if (err!=UNZ_OK) printf("error %d with zipfile in unzGetGlobalInfo /n",err); for (i=0;i<gi.number_entry;i++) { if (do_extract_currentfile(uf,&opt_extract_without_path, &opt_overwrite, password) != UNZ_OK) break; if ((i+1)<gi.number_entry) { err = unzGoToNextFile(uf); if (err!=UNZ_OK) { printf("error %d with zipfile in unzGoToNextFile/n",err); break; } } } return err;}
开发者ID:DankRank,项目名称:Nintendont,代码行数:30,
示例6: rarch_extract_zipfileint rarch_extract_zipfile(const char *zip_path){ unzFile uf = unzOpen(zip_path); unz_global_info gi; int err = unzGetGlobalInfo(uf, &gi); if (err != UNZ_OK) RARCH_ERR("error %d with ZIP file in unzGetGlobalInfo /n",err); for (unsigned i = 0; i < gi.number_entry; i++) { if (rarch_extract_currentfile_in_zip(uf) != UNZ_OK) break; if ((i + 1) < gi.number_entry) { err = unzGoToNextFile(uf); if (err != UNZ_OK) { RARCH_ERR("error %d with ZIP file in unzGoToNextFile/n",err); break; } } } if(g_console.info_msg_enable) rarch_settings_msg(S_MSG_EXTRACTED_ZIPFILE, S_DELAY_180); return 0;}
开发者ID:damariei,项目名称:RetroArch-Rpi,代码行数:30,
示例7: unzGetGlobalInfovoid Unzip::getGlobalInfo(void){ unz_global_info info; unzGetGlobalInfo(zipfile_handle, &info); numFiles = info.number_entry;}
开发者ID:uboot,项目名称:CppZip,代码行数:7,
示例8: unzip_get_number_entriesintunzip_get_number_entries (const char *filename){ FILE *file; unsigned char magic[4] = { 0 };#undef fopen#undef fread#undef fclose if ((file = fopen (filename, "rb")) == NULL) { errno = ENOENT; return -1; } fread (magic, 1, sizeof (magic), file); fclose (file);#define fopen fopen2#define fclose fclose2#define fread fread2 if (magic[0] == 'P' && magic[1] == 'K' && magic[2] == 0x03 && magic[3] == 0x04) { unz_global_info info; file = (FILE *) unzOpen (filename); unzGetGlobalInfo (file, &info); unzClose (file); return info.number_entry; } else return -1;}
开发者ID:GunioRobot,项目名称:quickdev16,代码行数:32,
示例9: unzOpen//===========================================================================//// Parameter: -// Returns: -// Changes Globals: -//===========================================================================quakefile_t *FindQuakeFilesInZip( char *zipfile, char *filter ) { unzFile uf; int err; unz_global_info gi; char filename_inzip[MAX_PATH]; unz_file_info file_info; int i; quakefile_t *qfiles, *lastqf, *qf; uf = unzOpen( zipfile ); err = unzGetGlobalInfo( uf, &gi ); if ( err != UNZ_OK ) { return NULL; } unzGoToFirstFile( uf ); qfiles = NULL; lastqf = NULL; for ( i = 0; i < gi.number_entry; i++ ) { err = unzGetCurrentFileInfo( uf, &file_info, filename_inzip, sizeof( filename_inzip ), NULL,0,NULL,0 ); if ( err != UNZ_OK ) { break; } ConvertPath( filename_inzip ); if ( FileFilter( filter, filename_inzip, false ) ) { qf = GetClearedMemory( sizeof( quakefile_t ) ); if ( !qf ) { Error( "out of memory" ); } memset( qf, 0, sizeof( quakefile_t ) ); strcpy( qf->pakfile, zipfile ); strcpy( qf->filename, zipfile ); strcpy( qf->origname, filename_inzip ); qf->zipfile = true; //memcpy( &buildBuffer[i].zipfileinfo, (unz_s*)uf, sizeof(unz_s)); memcpy( &qf->zipinfo, (unz_s*)uf, sizeof( unz_s ) ); qf->offset = 0; qf->length = file_info.uncompressed_size; qf->type = QuakeFileType( filename_inzip ); //add the file ot the list qf->next = NULL; if ( lastqf ) { lastqf->next = qf; } else { qfiles = qf;} lastqf = qf; } //end if unzGoToNextFile( uf ); } //end for unzClose( uf ); return qfiles;} //end of the function FindQuakeFilesInZip
开发者ID:AdrienJaguenet,项目名称:Enemy-Territory,代码行数:63,
示例10: EPUB3GetFileCountInArchiveuint32_t EPUB3GetFileCountInArchive(EPUB3Ref epub){ unz_global_info gi; int err = unzGetGlobalInfo(epub->archive, &gi); if (err != UNZ_OK) return err; return (uint32_t)gi.number_entry;}
开发者ID:UIKit0,项目名称:EPUB3Processor,代码行数:9,
示例11: unzGetGlobalInfoint Unzip::GetEntryCount(){ unz_global_info pglobal_info; m_errcode = unzGetGlobalInfo(m_unzFile, &pglobal_info); if (m_errcode != UNZ_OK) { return -1; } return (int)pglobal_info.number_entry;}
开发者ID:yunGit,项目名称:Torch,代码行数:9,
示例12: ZipArchiveFilestd::vector<std::pair<std::string, File*>> ZipArchive::GetFiles(){ std::vector<std::pair<std::string, File*>> result; unz_global_info globalInfo; if (unzGetGlobalInfo(archive, &globalInfo) != UNZ_OK) { return result; } for (uLong i = 0; i < globalInfo.number_entry; ++i) { // Get the filename size. unz_file_info fileInfo; if (unzGetCurrentFileInfo(archive, &fileInfo, NULL, 0, NULL, 0, NULL, 0) != UNZ_OK) { std::cerr << "Failed to read file info. Entry " << i << " in " << archivePath << std::endl; unzGoToNextFile(archive); continue; } // Get the filename now that we have the filename size. std::string filename; filename.resize(fileInfo.size_filename); if (unzGetCurrentFileInfo(archive, &fileInfo, &filename[0], filename.size(), NULL, 0, NULL, 0) != UNZ_OK) { std::cerr << "Failed to read file info. Entry " << i << " in " << archivePath << std::endl; unzGoToNextFile(archive); continue; } // Do not add directories. if (filename[filename.size() - 1] == '/') { unzGoToNextFile(archive); continue; } // Get the position of the file and create a file. unz_file_pos position; if (unzGetFilePos(archive, &position) != UNZ_OK) { std::cerr << "Failed to read file info. Entry " << i << " in " << archivePath << std::endl; continue; } File* file = new ZipArchiveFile(archive, fileInfo, position, &mutex); result.push_back(std::pair<std::string, File*>(filename, file)); // Move to the next file in the archive. unzGoToNextFile(archive); } return result;}
开发者ID:gamedevforks,项目名称:GEA2,代码行数:56,
示例13: BuildIndexbool nglZipFS::BuildIndex(){ int res; unzFile Zip = mpPrivate->mZip; unz_global_info global_info; if (UNZ_OK != unzGetGlobalInfo(Zip, &global_info)) return false; if (UNZ_OK != unzGoToFirstFile(Zip)) return false; do { unz_file_info file_info; unz_file_pos file_pos; char filename[4096]; if (UNZ_OK != unzGetCurrentFileInfo(Zip, &file_info, filename, 4096, NULL, 0, NULL, 0)) return false; if (UNZ_OK != unzGetFilePos(Zip, &file_pos)) return false; uint len = strlen(filename); bool IsDir = (filename[len-1] == '//') || (filename[len-1] == '/'); std::list<nglPath> List; nglZipPath::Decompose(filename, List); std::list<nglPath>::iterator it; std::list<nglPath>::iterator end = List.end(); Node* pPath = &mRoot; int i = List.size(); for (it = List.begin(); it != end; ++it) { nglString name = (*it).GetPathName(); Node* pChild = pPath->Find(name); if (!pChild) { //printf("zipfile: %s/n", name.GetChars()); pChild = new Node(name, file_info.uncompressed_size, file_pos.pos_in_zip_directory, file_pos.num_of_file, i == 1 && !IsDir); pPath->AddChild(pChild); } pPath = pChild; i--; } } while (UNZ_OK == (res = unzGoToNextFile(Zip))); if (res == UNZ_END_OF_LIST_OF_FILE) return true; return false;}
开发者ID:JamesLinus,项目名称:nui3,代码行数:56,
示例14: unzOpenbool Unzip::Open(const std::string &path){ m_unzFile = unzOpen(path.c_str()); unz_global_info pglobal_info; unzGetGlobalInfo(m_unzFile, &pglobal_info); printf("number_entry %lu/n", pglobal_info.number_entry); printf("number_disk_with_CD %lu/n", pglobal_info.number_disk_with_CD); return (m_unzFile != nullptr);}
开发者ID:yunGit,项目名称:Torch,代码行数:11,
示例15: readInZipFileNamevoid readInZipFileName(){ //FileUtils::getInstance()->getWritablePath(); //●●● filePath=/data/data/com.superman.plane/files/ ●●● std::string filePath = "/storage/sdcard0/Android/obb/com.superman.plane/"; std::string zipFile = "main.2.com.superman.plane.obb"; std::string imgFile = "assets/img_bg_1.jpg"; std::string path = filePath + zipFile; // zipファイルをopenし、ファイル数を取得します。 unzFile zipfile = unzOpen(path.c_str()); log( "--- path = %s ---" ,path.c_str()); unz_global_info global_info; if ( unzGetGlobalInfo( zipfile, &global_info ) != UNZ_OK ) { log( "could not read file global infon" ); unzClose( zipfile ); return; } // ファイルの先 C++ unzGoToFirstFile函数代码示例 C++ unzCloseCurrentFile函数代码示例
|