//! 压缩目录到某个目录下的ZIP文件/*!\param desfile目标文件,如D:\\test.zip\param srcdir源目录(要压缩的文件夹路径),如D:\\test\\*/void CModeSectionMgr::zipDirectory(char * desfile, char * srcdir){Poco::Path srcdir_path(srcdir);srcdir_path.makeDirectory();std::ofstream outstream(desfile, std::ios::binary);Poco::Zip::Compress compress(outstream, true);compress.addRecursive(srcdir_path, Poco::Zip::ZipCommon::CL_NORMAL);compress.close();outstream.close();}//! 解压缩ZIP文件到某个目录/*!\param desdir目标目录(要解压到的文件夹路径),如D:\\test\\\param srcfile源压缩文件,如D:\\test.zip*/void CModeSectionMgr::unZipDirectory(char * desdir, char * srcfile){std::ifstream instream(srcfile, std::ios::binary);Poco::Zip::Decompress decompress(instream, desdir); decompress.decompressAllFiles();instream.close();}
700字范文,内容丰富有趣,生活中的好帮手!