class ZipLocalFileHeader

Library: Zip
Package: Zip
Header: Poco/Zip/ZipLocalFileHeader.h


Stores a Zip local file header

Member Summary

Member Functions: createHeader, getCRC, getCompressedSize, getCompressionLevel, getCompressionMethod, getDataEndPos, getDataStartPos, getEndPos, getExtraField, getFileName, getHeaderSize, getHostSystem, getMajorVersionNumber, getMinorVersionNumber, getRequiredVersion, getStartPos, getUncompressedSize, hasData, hasExtraField, isDirectory, isEncrypted, isFile, lastModifiedAt, needsZip64, searchCRCAndSizesAfterData, setCRC, setCompressedSize, setFileName, setSearchCRCAndSizesAfterData, setStartPos, setUncompressedSize, setZip64Data



    std::istream & inp,
    bool assumeHeaderRead,
    ParseCallback & callback

Creates the ZipLocalFileHeader by parsing the input stream. If assumeHeaderRead is true we assume that the first 4 bytes were already read outside. If skipOverDataBlock is true we position the stream after the data block (either at the next FileHeader or the Directory Entry)


    const Poco::Path & fileName,
    const Poco::DateTime & lastModifiedAt,
    ZipCommon::CompressionMethod cm,
    ZipCommon::CompressionLevel cl,
    bool forceZip64 = false

Creates a zip file header from an absoluteFile. fileName is the name of the file in the zip, outputIsSeekable determines if we write CRC and file sizes to the LocalFileHeader or after data compression into a ZipDataInfo If forceZip64 is set true then the file header is allocated with zip64 extension.


~ZipLocalFileHeader virtual

virtual ~ZipLocalFileHeader();

Destroys the ZipLocalFileHeader.

Member Functions


std::string createHeader() const;

Creates a header

getCRC inline

Poco::UInt32 getCRC() const;

getCompressedSize inline

Poco::UInt64 getCompressedSize() const;

getCompressionLevel inline

ZipCommon::CompressionLevel getCompressionLevel() const;

Returns the compression level used. Only valid when the compression method is CM_DEFLATE

getCompressionMethod inline

ZipCommon::CompressionMethod getCompressionMethod() const;

getDataEndPos inline

std::streamoff getDataEndPos() const;

getDataStartPos inline

std::streamoff getDataStartPos() const;

Returns the streamoffset for the very first byte of data. Will be equal to DataEndPos if no data present

getEndPos inline

std::streamoff getEndPos() const;

Points past the last byte of the file entry (ie. either the first byte of the next header, or the directory)

getExtraField inline

const std::string & getExtraField() const;

getFileName inline

const std::string & getFileName() const;

getHeaderSize inline

Poco::UInt32 getHeaderSize() const;

Returns the total size of the header including filename + extra field size

getHostSystem inline

ZipCommon::HostSystem getHostSystem() const;

getMajorVersionNumber inline

int getMajorVersionNumber() const;

getMinorVersionNumber inline

int getMinorVersionNumber() const;

getRequiredVersion inline

void getRequiredVersion(
    int & major,
    int & minor

The minimum version required to extract the data

getStartPos inline

std::streamoff getStartPos() const;

Returns the position of the first byte of the header in the file stream

getUncompressedSize inline

Poco::UInt64 getUncompressedSize() const;

hasData inline

bool hasData() const;

hasExtraField inline

bool hasExtraField() const;

isDirectory inline

bool isDirectory() const;

isEncrypted inline

bool isEncrypted() const;

isFile inline

bool isFile() const;

lastModifiedAt inline

const Poco::DateTime & lastModifiedAt() const;

needsZip64 inline

bool needsZip64() const;


bool searchCRCAndSizesAfterData() const;

setCRC inline

void setCRC(
    Poco::UInt32 val

setCompressedSize inline

void setCompressedSize(
    Poco::UInt64 val


void setFileName(
    const std::string & fileName,
    bool isDirectory

setSearchCRCAndSizesAfterData inline

void setSearchCRCAndSizesAfterData(
    bool val

setStartPos inline

void setStartPos(
    std::streamoff start

Sets the start position to start and the end position to start+compressedSize

setUncompressedSize inline

void setUncompressedSize(
    Poco::UInt64 val

setZip64Data inline

void setZip64Data();


HEADER static

static const char HEADER[ZipCommon::HEADER_SIZE];