QByteArray ew::app::publishing::ZipEntry::content
The entry's raw bytes.
#include <ew/app/publishing/ZipWriter.h>
Namespace ew::app::publishing
struct ew::app::publishing::ZipEntry
One file to place in a ZIP archive: its archive path (forward-slash separated, e.g. "word/document.xml") and its raw bytes.
QString ew::app::publishing::ZipEntry::path
The entry's archive path, forward-slash separated (e.g. "word/document.xml").
QByteArray ew::app::publishing::ZipEntry::content
The entry's raw bytes.
QByteArray ew::app::publishing::makeZip(const std::vector< ZipEntry > &entries)
Builds a complete ZIP archive containing entries, stored uncompressed (method 0). This is dependency-free (no vendored zip library, no Qt private API) and sufficient for the Office Open XML (DOCX) and EPUB3 containers, whose readers accept stored entries; entry order is preserved, so a caller can place a required first entry (e.g. EPUB's uncompressed "mimetype"). Uses a fixed timestamp so the same input yields byte-identical output.
It writes the ORIGINAL ZIP headers, not ZIP64, so zipOverflowReason bounds what it can address. Beyond those bounds the count and offset fields wrap while the bytes are still written, and the archive that comes out is not short by a visible amount – it is well-formed and quietly missing files. Anything writing a user's data must ask first.
quint32 ew::app::publishing::zipCrc32(const QByteArray &data)
Computes the standard (ISO-HDLC / zlib) CRC-32 of data – the checksum ZIP archives store per entry. Exposed so callers (and tests) can verify entry integrity; makeZip uses it internally.
QString ew::app::publishing::zipOverflowReason(const std::vector< ZipEntry > &entries)
Why entries cannot be written as one archive, or an empty string when they can.
The original ZIP end-of-central-directory record counts entries in 16 bits and addresses the archive in 32, so makeZip can hold at most 65,535 files totalling under 4 GiB. Asked here rather than inside makeZip because makeZip returns bytes and has nowhere to say no; every caller that is writing something a user cannot afford to lose – a project bundle above all – checks this and refuses, exactly as packProjectBundle already refuses a file it cannot read. The wording is the caller's to show, so this returns the reason rather than a bool.