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

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

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

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

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

示例1: save_archive

static int save_archive(char *filename, char *buffer, int size){	    zipFile fd = NULL;    int ret = 0;    fd=zipOpen(filename,0);    if(!fd)    {       printf("Failed to create zip/r/n");       return (0);    }    ret=zipOpenNewFileInZip(fd,"SNAPSHOT",			    NULL,				NULL,0,			    NULL,0,			    NULL,			    Z_DEFLATED,			    Z_BEST_COMPRESSION);			        if(ret != ZIP_OK)    {       zipClose(fd,NULL);       printf("Failed to create file in zip/r/n");       return (0);        }    ret=zipWriteInFileInZip(fd,buffer,size);    if(ret != ZIP_OK)    {      zipCloseFileInZip(fd);      zipClose(fd,NULL);      printf("Failed to write file in zip/r/n");      return (0);    }    ret=zipCloseFileInZip(fd);    if(ret != ZIP_OK)    {      zipClose(fd,NULL);      printf("Failed to close file in zip/r/n");      return (0);    }    ret=zipClose(fd,NULL);    if(ret != ZIP_OK)    {      printf("Failed to close zip/r/n");      return (0);    }	    return(1);}
开发者ID:jeremyfry,项目名称:PocketSNES,代码行数:52,


示例2: zipClose

void ZipFileHandler::OnHandleDestroy(HandleType_t, void *object){    if (NULL != object)    {        zipClose((zipFile)object, NULL);    }}
开发者ID:pmrowla,项目名称:sm-zip,代码行数:7,


示例3: f

/*Trying to write offset and vertices data to file.*/void CPathEstimator::WriteFile(string name) {	// We need this directory to exist	boost::filesystem::path f("./maps/paths");	if (!boost::filesystem::exists(f))		boost::filesystem::create_directories(f);	unsigned int hash = Hash();	char hashString[50];	sprintf(hashString,"%u",hash);	string filename = string("maps/paths/") + stupidGlobalMapname.substr(0, stupidGlobalMapname.find('.') + 1) + hashString + "." + name + ".zip";	zipFile file = zipOpen(filename.c_str(), APPEND_STATUS_CREATE);	if (file) {		zipOpenNewFileInZip(file, "pathinfo", NULL, NULL, 0, NULL, 0, NULL, Z_DEFLATED, Z_BEST_COMPRESSION);				//Write hash.		unsigned int hash = Hash();		zipWriteInFileInZip(file, (void*)&hash, 4);		//Write block-center-offsets.		int blocknr;		for(blocknr = 0; blocknr < nbrOfBlocks; blocknr++) {			zipWriteInFileInZip(file, (void*)blockState[blocknr].sqrCenter, moveinfo->moveData.size() * sizeof(int2));			//file.write((char*)blockState[blocknr].sqrCenter, moveinfo->moveData.size() * sizeof(int2));		}		//Write vertices.		zipWriteInFileInZip(file, (void*)vertex, nbrOfVertices * sizeof(float));		//file.write((char*)vertex, nbrOfVertices * sizeof(float));		zipCloseFileInZip(file);		zipClose(file, NULL);	}}
开发者ID:genxinzou,项目名称:svn-spring-archive,代码行数:38,


示例4: zipClose

bool ZipFile::SwitchMode(short mode){    if(mode == ZipFile::OPEN)    {        if(zFile)        {            zipClose(zFile, NULL);            zFile = 0;        }        if(!uzFile)            uzFile = unzOpen(ZipFilePath.c_str());        return (uzFile != 0);    }    else if(mode == ZipFile::CREATE || mode == ZipFile::APPEND)    {        if(uzFile)        {            unzClose(uzFile);            uzFile = 0;        }        if(!zFile)            zFile = zipOpen(ZipFilePath.c_str(), mode);        return (zFile != 0);    }    return false;}
开发者ID:Gamer125,项目名称:wiibrowser,代码行数:31,


示例5: fill_win32_filefunc64

bool ZipCreator::SaveAs(const WCHAR *zipFilePath){    if (d->pathsAndZipNames.Count() == 0)        return false;    zlib_filefunc64_def ffunc;    fill_win32_filefunc64(&ffunc);    zipFile zf = zipOpen2_64(zipFilePath, 0, NULL, &ffunc);    if (!zf)        return false;    bool result = true;    for (size_t i = 0; i < d->pathsAndZipNames.Count(); i += 2) {        const WCHAR *fileName = d->pathsAndZipNames.At(i);        const WCHAR *nameInZip = d->pathsAndZipNames.At(i + 1);        size_t fileSize;        ScopedMem<char> fileData(file::ReadAll(fileName, &fileSize));        if (!fileData) {            result = false;            break;        }        result = AppendFileToZip(zf, nameInZip, fileData, fileSize);        if (!result)            break;    }    int err = zipClose(zf, NULL);    if (err != ZIP_OK)        result = false;    return result;}
开发者ID:kindleStudy,项目名称:sumatrapdf,代码行数:29,


示例6: throw

void FileUtils::addToZip(const char* archivePath, const char* path, const char* content, int length) throw (IOException){	int result = ZIP_OK;	int appendMode = fileExists(archivePath) ? APPEND_STATUS_ADDINZIP : APPEND_STATUS_CREATE;	zipFile archive = zipOpen(archivePath, appendMode);	result = zipOpenNewFileInZip(archive, path, 0 /* file attributes */, 0 /* extra field */, 0 /* extra field size */,						0/* global extra field */, 0 /* global extra field size */, 0 /* comment */, Z_DEFLATED /* method */,						Z_DEFAULT_COMPRESSION /* level */);	if (result != ZIP_OK)	{		throw IOException("Unable to add new file to zip archive");	}	result = zipWriteInFileInZip(archive, content, static_cast<unsigned int>(length));	if (result != ZIP_OK)	{		throw IOException("Unable to write file data to zip archive");	}	result = zipCloseFileInZip(archive);	if (result != ZIP_OK)	{		throw IOException("Unable to close file in zip archive");	}	result = zipClose(archive, 0 /* global comment */);	if (result != ZIP_OK)	{		throw IOException("Unable to close zip archive");	}}
开发者ID:GlPortal,项目名称:Update-Installer,代码行数:30,


示例7: zipClose

//-----------------------------------------------------------------------------// CZLib::Close//// Close open zip file//void CZLib::Close(){   if (m_zf)      zipClose(m_zf, NULL);   m_zf = 0;}
开发者ID:fatterbetter,项目名称:ZTools,代码行数:12,


示例8: switch

void QuaZip::close(){  p->zipError=UNZ_OK;  switch(p->mode) {    case mdNotOpen:      qWarning("QuaZip::close(): ZIP is not open");      return;    case mdUnzip:      p->zipError=unzClose(p->unzFile_f);      break;    case mdCreate:    case mdAppend:    case mdAdd:      p->zipError=zipClose(p->zipFile_f, p->commentCodec->fromUnicode(p->comment).constData());      break;    default:      qWarning("QuaZip::close(): unknown mode: %d", (int)p->mode);      return;  }  // opened by name, need to delete the internal IO device  if (!p->zipName.isEmpty())    delete p->ioDevice;  if(p->zipError==UNZ_OK)    p->mode=mdNotOpen;}
开发者ID:valentinos,项目名称:ModMine,代码行数:25,


示例9: fill_win32s_filefunc64

// TODO: using this for XPS files results in documents that Microsoft XPS Viewer can't readIStream *OpenDirAsZipStream(const WCHAR *dirPath, bool recursive){    if (!dir::Exists(dirPath))        return NULL;    ScopedComPtr<IStream> stream;    if (FAILED(CreateStreamOnHGlobal(NULL, TRUE, &stream)))        return NULL;    zlib_filefunc64_def ffunc;    fill_win32s_filefunc64(&ffunc);    zipFile zf = zipOpen2_64(stream, 0, NULL, &ffunc);    if (!zf)        return NULL;    size_t dirLen = str::Len(dirPath);    if (!path::IsSep(dirPath[dirLen - 1]))        dirLen++;    bool ok = true;    DirIter di(dirPath, recursive);    for (const WCHAR *filePath = di.First(); filePath && ok; filePath = di.Next()) {        CrashIf(!str::StartsWith(filePath, dirPath));        const WCHAR *nameInZip = filePath + dirLen;        size_t fileSize;        ScopedMem<char> fileData(file::ReadAll(filePath, &fileSize));        ok = fileData && AppendFileToZip(zf, nameInZip, fileData, fileSize);    }    int err = zipClose(zf, NULL);    if (!ok || err != ZIP_OK)        return NULL;    stream->AddRef();    return stream;}
开发者ID:tin-pot,项目名称:sumatrapdf,代码行数:36,


示例10: zipClose

bool ZipFile::Close(QString comment){	if (!zf)		return false;	bool success = zipClose(zf, comment.toAscii().constData()) == ZIP_OK;	zf = NULL;	return success;}
开发者ID:timo-e,项目名称:MobileMaps,代码行数:8,


示例11: ClearList

ZipFile::~ZipFile(){    ClearList();    if(uzFile)        unzClose(uzFile);    if(zFile)        zipClose(zFile, NULL);}
开发者ID:Gamer125,项目名称:wiibrowser,代码行数:8,


示例12: zipClose

void ZipArchive::close(){	if (!isOpen())		return;		zipClose(d->zip, 0);	d->zip = 0;}
开发者ID:h2so5,项目名称:PaintField,代码行数:8,


示例13: close_ZIP_archive

voidclose_ZIP_archive(void){	if (unzipping)		unzClose(unzip_handle);	else		zipClose(zip_handle, NULL);}
开发者ID:docbrown,项目名称:3dml,代码行数:8,


示例14: zipClose

		ZipArchiveImpl::~ZipArchiveImpl()		{			int r = ZIP_OK;			if (m_File)				r = zipClose(m_File, ":)");			m_File = nullptr;			m_Info = ArchiveInfo();		}
开发者ID:Kezeali,项目名称:Fusion,代码行数:8,


示例15: Event

BOOL fsUploadMgr::ZipFiles (){	if (m_bZipFileCreated)		return TRUE;	Event (UMGRE_ZIP_FILES_START);	char szTmpFile [MAX_PATH];	char szTmpPath [MAX_PATH];	GetTempPath (MAX_PATH, szTmpPath);	GetTempFileName (szTmpPath, "tmp", 0, szTmpFile);	m_strUploadFile = szTmpFile;		zipFile zip = zipOpen (m_strUploadFile, 0);	BOOL bOk = TRUE;	m_strZipContentsDescHtml = "<ul>";	for (size_t i = 0; i < m_pkg.m_vPathes.size () && bOk && m_bNeedStop == false; i++)	{		LPCSTR psz = m_pkg.m_vPathes [i];		char szName [1000] = "";		fsGetFileName (psz, szName);		if (GetFileAttributes (psz) & FILE_ATTRIBUTE_DIRECTORY)		{			AddItemToZipContentsDescHtml (szName, _UI64_MAX);			m_strZipContentsDescHtml += "<ul>";			bOk = bOk && Zip_AddFolder (zip, psz, NULL, 1);			m_strZipContentsDescHtml += "</ul>";		}		else		{			bOk = bOk && Zip_AddFile (zip, psz, NULL);			if (bOk)			{				WIN32_FILE_ATTRIBUTE_DATA wfad;				GetFileAttributesEx (psz, GetFileExInfoStandard, &wfad);				AddItemToZipContentsDescHtml (szName, ((UINT64)wfad.nFileSizeHigh << 32) + wfad.nFileSizeLow);			}		}	}	m_strZipContentsDescHtml += "</ul>";	zipClose (zip, NULL);	if (m_bNeedStop || bOk == FALSE)		DeleteFile (m_strUploadFile);	else		m_bZipFileCreated = TRUE;	if (m_bNeedStop == false)		Event (bOk ? UMGRE_ZIP_FILES_DONE : UMGRE_ZIP_FILES_FAILED);	return m_bZipFileCreated;}
开发者ID:andyTsing,项目名称:freedownload,代码行数:58,


示例16: zipClose

bool Zip::Close(){    if (m_zipFile) {        m_errcode = zipClose(m_zipFile, nullptr);        m_zipFile = nullptr;        return m_errcode == ZIP_OK;    }    return true;}
开发者ID:yunGit,项目名称:Torch,代码行数:9,


示例17: zipClose

 void ZipWriter::Close() {   if (IsOpen())   {     zipClose(pimpl_->file_, "Created by Orthanc");     pimpl_->file_ = NULL;     hasFileInZip_ = false;   } }
开发者ID:freemed,项目名称:orthanc,代码行数:9,


示例18: ZipOpen_Memory

//by stonebool FileSystemZip::Init_zMemory(std::string NameInZip, unsigned char* buf, int size, int append){	unzFile			zf;	zip_fileinfo	zi;	time_t			tm_t;	struct tm*		filedate;	int				opt_compress_level = Z_BEST_COMPRESSION; //use best compress	if( m_compress_buf )	{		delete m_compress_buf;		m_compress_buf = NULL;	}	m_compress_buf = new byte[size];		zf = ZipOpen_Memory(m_compress_buf, size, append);	if (!zf)	{		LogError("Cannot create memory using");		return false;	}	LogMsg("deflate zip as memory");	memset(&zi,0,sizeof(zip_fileinfo));		tm_t		= time(NULL);	filedate	= localtime(&tm_t);				zi.tmz_date.tm_sec  = filedate->tm_sec;	zi.tmz_date.tm_min  = filedate->tm_min;	zi.tmz_date.tm_hour = filedate->tm_hour;	zi.tmz_date.tm_mday = filedate->tm_mday;	zi.tmz_date.tm_mon  = filedate->tm_mon ;	zi.tmz_date.tm_year = filedate->tm_year;	zipOpenNewFileInZip(zf,						NameInZip.c_str(),						&zi,						NULL,						0,						NULL,						0,						NULL,						Z_DEFLATED,						opt_compress_level);	zipWriteInFileInZip(zf,buf,size);	zipCloseFileInZip(zf);		m_zip_size = zipClose(zf, NULL);		//m_zipFileName = zipFileName; //save it in case we need to spawn more zip readers for streaming operations	//CacheIndex();	return true; //success}
开发者ID:fatalfeel,项目名称:proton_sdk_source,代码行数:58,


示例19: SetCurrentDirectoryW

// ////////////////////////////////////////////////////////////////////////////////// @public @static 将指定文件名打包成指定 zip//bool ZipTools::Zip(LPCWSTR wzDirPath, LPCWSTR wzDestName){	//	// 检查指定路径是否存在	//	if ( !FileTools::Exist(wzDirPath) )	{		DebugTools::OutputDebugPrintfW(L"[ZipTools] [Zip] Path Not Exist. [%s]/r/n", wzDirPath);		return false;	}	WCHAR wzDestDir[MAX_PATH] = {0};	FileTools::GetFileDir(wzDestName, wzDestDir, L'//');	if ( !FileTools::Exist(wzDestDir) )	{		DebugTools::OutputDebugPrintfW(L"[ZipTools] [Zip] Path Not Exist. [%s]/r/n", wzDestDir);		return false;	}	// 设置当前工作目录	SetCurrentDirectoryW(wzDirPath);	WCHAR wzParentDir[MAX_PATH] = {0};	wcscpy_s(wzParentDir, wzDirPath);	//FileTools::GetFileDir(wzDirPath, wzParentDir, L'//');	wcscat_s(wzParentDir, L"//");	//	// 创建 zip 文件	//	zlib_filefunc64_def ffunc;	fill_win32_filefunc64W(&ffunc);	zipFile zf; zf = zipOpen2_64(wzDestName, 0, NULL, &ffunc);	if ( NULL == zf )	{		DebugTools::OutputDebugPrintfW(			L"[ZipTools] [Zip] Create Zip File Failed. [%s] /r/n", wzDestName);		return false;	}	unsigned long size_read = 0;	unsigned long size_buf = WRITEBUFFERSIZE;	PBYTE buf = new BYTE [size_buf];	//	// 将文件夹下所有文件添加进 zip	//	AddFileToZip(zf, wzDirPath, wzParentDir, buf);	zipClose(zf,NULL);	delete [] buf;	return true;}
开发者ID:sssooonnnggg,项目名称:LibSrn,代码行数:60,


示例20: hts_extract_meta

int hts_extract_meta(const char* path) {    char catbuff[CATBUFF_SIZE];    unzFile zFile = unzOpen(fconcat(catbuff,path,"hts-cache/new.zip"));    zipFile zFileOut = zipOpen(fconcat(catbuff,path,"hts-cache/meta.zip"), 0);    if (zFile != NULL && zFileOut != NULL) {        if (unzGoToFirstFile(zFile) == Z_OK) {            zip_fileinfo fi;            unz_file_info ufi;            char BIGSTK filename[HTS_URLMAXSIZE * 4];            char BIGSTK comment[8192];            memset(comment, 0, sizeof(comment));       // for truncated reads            memset(&fi, 0, sizeof(fi));            memset(&ufi, 0, sizeof(ufi));            do  {                int readSizeHeader;                filename[0] = '/0';                comment[0] = '/0';                if (unzOpenCurrentFile(zFile) == Z_OK) {                    if (                        (readSizeHeader = unzGetLocalExtrafield(zFile, comment, sizeof(comment) - 2)) > 0                        &&                        unzGetCurrentFileInfo(zFile, &ufi, filename, sizeof(filename) - 2, NULL, 0, NULL, 0) == Z_OK                    )                    {                        comment[readSizeHeader] = '/0';                        fi.dosDate = ufi.dosDate;                        fi.internal_fa = ufi.internal_fa;                        fi.external_fa = ufi.external_fa;                        if (zipOpenNewFileInZip(zFileOut,                                                filename,                                                &fi,                                                NULL,                                                0,                                                NULL,                                                0,                                                NULL, /* comment */                                                Z_DEFLATED,                                                Z_DEFAULT_COMPRESSION) == Z_OK)                        {                            if (zipWriteInFileInZip(zFileOut, comment, (int) strlen(comment)) != Z_OK) {                            }                            if (zipCloseFileInZip(zFileOut) != Z_OK) {                            }                        }                    }                    unzCloseCurrentFile(zFile);                }            } while( unzGoToNextFile(zFile) == Z_OK );        }        zipClose(zFileOut, "Meta-data extracted by HTTrack/"HTTRACK_VERSION);        unzClose(zFile);        return 1;    }    return 0;}
开发者ID:siegleal,项目名称:Crawler,代码行数:56,


示例21: HB_GARBAGE_FUNC

static HB_GARBAGE_FUNC( hb_zipfile_destructor ){   zipFile * phZip = ( zipFile * ) Cargo;   if( *phZip )   {      zipClose( *phZip, NULL );      *phZip = NULL;   }}
开发者ID:ggargano,项目名称:hbtest2,代码行数:10,


示例22: zipClose

void MkInterfaceForZipFileWriting::Clear(void){	if (m_ZipFile != NULL)	{		m_CurrentFilePath.Clear();		zipClose(m_ZipFile, NULL);		m_ZipFile = NULL;	}}
开发者ID:jaeseock,项目名称:MiniKey,代码行数:10,


示例23: zipClose

/*========================idZipBuilder::CleanSourceFolderthis folder is assumed to be a path under FSPATH_BASE========================*/void idZipBuilder::CloseZipFile( zipFile zf ){	// close the zip file	int closeError = zipClose( zf, zipFileName );	if( closeError != ZIP_OK )	{		idLib::Warning( "[%s] - error closing file '%s'!", __FUNCTION__, zipFileName.c_str() );	}	idLib::PrintfIf( zip_verbosity.GetBool(), "Done./n" );}
开发者ID:asd55,项目名称:RBDOOM-3-BFG,代码行数:17,


示例24: archive_Compress

// ----------------------------------------------------------------------------// Compress// ----------------------------------------------------------------------------bool archive_Compress(std::string zipFilename, std::string filename, const byte* data, uint size) {  if(zipFilename.empty( ) || zipFilename.size( ) == 0) {    logger_LogError("Zip filename is invalid.", ARCHIVE_SOURCE);    return false;  }    if(filename.empty( ) || filename.size( ) == 0) {    logger_LogError("Filename is invalid.", ARCHIVE_SOURCE);    return false;  }  if(data == NULL) {    logger_LogError("Data parameter is invalid.", ARCHIVE_SOURCE);    return false;    }    zipFile file = zipOpen(zipFilename.c_str( ), APPEND_STATUS_CREATE);  if(file == NULL) {    logger_LogInfo("Failed to create the zip file " + zipFilename + ".", ARCHIVE_SOURCE);    return false;  }    zip_fileinfo fileInfo = {0};  fileInfo.dosDate = 1;    int result = zipOpenNewFileInZip(file, filename.c_str( ), &fileInfo, NULL, 0, NULL, 0, NULL, Z_DEFLATED, Z_BEST_COMPRESSION);  if(result != ZIP_OK) {    logger_LogInfo("Failed to open a new file within the zip file " + filename + ".", ARCHIVE_SOURCE);    logger_LogInfo("Result: " + result, ARCHIVE_SOURCE);    zipClose(file, "Failed to compress.");    return false;    }    result = zipWriteInFileInZip(file, data, size);  if(result != ZIP_OK) {    logger_LogInfo("Failed to write data to the zip file " + filename + ".", ARCHIVE_SOURCE);    zipCloseFileInZip(file);    zipClose(file, "Failed to compress.");    return false;  }   zipCloseFileInZip(file);  zipClose(file, "Comment");  return true;}
开发者ID:clobber,项目名称:wii7800,代码行数:46,


示例25: zipClose

void ZipArchiveWriter::Close(){    m_errCode = Z_ERRNO;    if (m_hZip)    {        zipClose(m_hZip, nullptr);        m_hZip = nullptr;    }}
开发者ID:wqx081,项目名称:mpr_mq,代码行数:10,


示例26: zipClose

bool CZipper::CloseZip(){	int nRet = m_uzFile ? zipClose(m_uzFile, NULL) : ZIP_OK;	m_uzFile = NULL;	m_szRootFolder[0] = 0;	ZeroMemory(&m_info, sizeof(m_info));	return (nRet == ZIP_OK);}
开发者ID:chief1983,项目名称:Imperial-Alliance,代码行数:10,


示例27: writezip_cb

static int writezip_cb(lua_State* L){	const char* zipname = luaL_checkstring(L, 1);	luaL_checktype(L, 2, LUA_TTABLE);	int result = 0;	zipFile zf = zipOpen(zipname, APPEND_STATUS_CREATE);	if (zf)	{		result = 1;		lua_pushnil(L);		while (lua_next(L, 2) != 0)		{			const char* key = lua_tostring(L, -2);			size_t valuelen;			const char* value = lua_tolstring(L, -1, &valuelen);			int i = zipOpenNewFileInZip(zf, key, NULL,					NULL, 0,					NULL, 0,					NULL,					Z_DEFLATED,					Z_DEFAULT_COMPRESSION);			if (i != ZIP_OK)			{				result = 0;				break;			}			i = zipWriteInFileInZip(zf, value, valuelen);			if (i != ZIP_OK)			{				result = 0;				break;			}			i = zipCloseFileInZip(zf);			if (i != ZIP_OK)			{				result = 0;				break;			}			lua_pop(L, 1); /* leave key on stack */		}		zipClose(zf, NULL);	}	if (!result)		return 0;	lua_pushboolean(L, true);	return 1;}
开发者ID:NRauh,项目名称:wordgrinder,代码行数:55,


示例28: unzClose

void QZipFile::close(){    if (m_unzFile) {        unzClose(m_unzFile);        m_unzFile = 0;    }    if (m_zipFile) {        zipClose(m_zipFile, NULL);        m_zipFile = NULL;    }}
开发者ID:gonzoua,项目名称:qompress,代码行数:12,


示例29: FILE_compress_dir

int FILE_compress_dir(const string& src_path, const string& dst_path, const string& prefix){	zipFile archive = zipOpen(dst_path.c_str(), 0);	if(archive == NULL)		return -1;	int r = compress_recursive(archive, src_path,prefix);		zipClose(archive, NULL);		return r;	}
开发者ID:highattack30,项目名称:xptools,代码行数:13,


示例30: CompressFiles

	bool CompressFiles(const wchar_t* zip_file_path, const RequestFileCallback& callback, void* pParam, int compression_level)	{		zipFile zip_file_handle = zipOpenHelp(zip_file_path);		if(NULL != zip_file_handle)		{			zip_fileinfo zi = {0};#if defined(_WIN32) || defined (_WIN64)			SYSTEMTIME currTime;			GetLocalTime( &currTime );			zi.tmz_date.tm_sec = currTime.wSecond;			zi.tmz_date.tm_min = currTime.wMinute;			zi.tmz_date.tm_hour = currTime.wHour;			zi.tmz_date.tm_mday = currTime.wDay;			zi.tmz_date.tm_mon = currTime.wMonth;			zi.tmz_date.tm_year = currTime.wYear;#endif			BYTE* pData = NULL;			long nSize;			std::wstring in_zip_filename;			while(callback(in_zip_filename, pData, nSize, pParam))			{				std::string in_zip_filenameA = codepage_issue_fixToOEM(in_zip_filename);				if (ZIP_OK != zipOpenNewFileInZip( zip_file_handle, in_zip_filenameA.c_str(), &zi, NULL, 0, NULL, 0, NULL, Z_DEFLATED, compression_level ) ||					ZIP_OK != zipWriteInFileInZip(zip_file_handle, pData, nSize) ||					ZIP_OK != zipCloseFileInZip(zip_file_handle))				{					zipClose(zip_file_handle, NULL);					return false;				}			}			zipClose(zip_file_handle, NULL);			return true;		}		return false;	}
开发者ID:ONLYOFFICE,项目名称:core,代码行数:38,



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


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