Library: Zip
Package: Manipulation
Header: Poco/Zip/ZipManipulator.h
ZipManipulator allows to add/remove/update files inside zip files
Member Functions: addFile, commit, deleteFile, originalArchive, renameFile, replaceFile
ZipManipulator(
const std::string & zipFile,
bool backupOriginalFile
);
Creates the ZipManipulator.
virtual ~ZipManipulator();
Destroys the ZipManipulator.
void addFile(
const std::string & zipPath,
const std::string & localPath,
ZipCommon::CompressionMethod cm = ZipCommon::CM_DEFLATE,
ZipCommon::CompressionLevel cl = ZipCommon::CL_MAXIMUM
);
Adds a file to the zip file.
ZipArchive commit();
Commits all changes and re-creates the Zip File with the changes applied. Returns the ZipArchive for the newly created archive
Changes will be first written to a temporary file, then the originalfile will be either deleted or renamed to .bak, then, the temp file will be renamed to the original zip file name.
void deleteFile(
const std::string & zipPath
);
Removes the given file from the Zip archive.
const ZipArchive & originalArchive() const;
Returns the original archive information
void renameFile(
const std::string & zipPath,
const std::string & newZipPath
);
Renames the file in the archive to newZipPath
void replaceFile(
const std::string & zipPath,
const std::string & localPath
);
Replaces the contents of the file in the archive with the contents from the file given by localPath.
Poco::FIFOEvent < const ZipLocalFileHeader > EDone;