ZipWriter class
#include <Jazz2/Utils/ZipWriter.h>
Writes a ZIP archive.
Files are added one after another, each compressed by Deflate unless it doesn't get smaller then, and the archive is completed by Finish(). The names are UTF-8 with / between directories. Archives larger than 4 GB, which would need ZIP64, aren't supported.
Public static functions
-
static auto Crc32(ArrayView<const std::
uint8_t> data) -> std:: uint32_t - Returns the CRC-32 of data, as ZIP and PNG use it.
Constructors, destructors, conversion operators
Public functions
- auto operator=(const ZipWriter&) -> ZipWriter& deleted
-
auto AddFile(StringView name,
ArrayView<const std::
uint8_t> data) -> bool - Adds a file, returns
falseif it couldn't be written. - auto Finish() -> bool
- Writes the directory of the archive, returns
falseif anything couldn't be written. -
auto GetCount() const -> std::
size_t - Returns the number of files added.