Open danielweck opened 8 years ago
https://github.com/readium/readium-sdk/blob/develop/ePub3/ThirdParty/libzip/zip_add_dir.c
zip_add_dir(struct zip *za, const char *name)
https://github.com/readium/readium-sdk/blob/develop/ePub3/ePub/zip_archive.cpp#L226
bool ZipArchive::CreateFolder(const string & path)
{
return (zip_add_dir(_zip, Sanitized(path).c_str()) >= 0);
}
https://github.com/readium/readium-sdk/blob/develop/ePub3/ePub/zip_archive.h#L74
virtual bool CreateFolder(const string & path);
https://github.com/readium/readium-sdk/blob/develop/ePub3/ePub/archive.h#L168
/**
Creates a folder in an archive.
@param path The path within the archive for the new folder.
@result Returns `true` if the polder was created, `false` otherwise.
*/
virtual bool CreateFolder(const string & path) = 0;
https://github.com/readium/readium-lcp-client/blob/develop/src/lcp-client-lib/Acquisition.cpp#L173
ZipFile::AddFile(m_publicationPath, licenseStream, "META-INF/license.lcpl");
void ZipFile::AddFile(const std::string& zipPath, std::istream& dataStream, const std::string& inArchiveName, ICompressionMethod::Ptr method)
https://github.com/readium/readium-sdk/blob/develop/ePub3/ThirdParty/libzip/zip_add.c
zip_add(struct zip *za, const char *name, struct zip_source *source)
TODO: replace ZipFile::AddFile
in LCP client lib with zip_add
from ReadiumSDK's built-in static zip lib.
(as per above code snippets, zip_add_dir
illustrates the usage of the C API from the CPP "archive" logical layer)
Also note that CryptoPP Crypto++ has its own zip lib: https://github.com/weidai11/cryptopp/blob/master/zdeflate.h https://github.com/weidai11/cryptopp/blob/master/zinflate.h
https://github.com/weidai11/cryptopp/blob/master/zlib.h https://github.com/weidai11/cryptopp/blob/master/gzip.h
https://github.com/readium/readium-lcp-client/tree/develop/src/third-parties/cryptopp/
Note existing issues: https://bitbucket.org/wbenny/ziplib/issues?status=new&status=open (mirror: https://github.com/kypp/ziplib )
In particular: 64-bit support: https://bitbucket.org/wbenny/ziplib/issues/32/zip64-support no-file support: https://bitbucket.org/wbenny/ziplib/issues/35/add-encode-deconde-decode-encode-stream
See: https://github.com/readium/readium-sdk/issues/232