Library: Zip
Package: Zip
Header: Poco/Zip/ZipLocalFileHeader.h
Stores a Zip local file header
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, searchCRCAndSizesAfterData, setCRC, setCompressedSize, setFileName, setSearchCRCAndSizesAfterData, setStartPos, setUncompressedSize
ZipLocalFileHeader(
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)
ZipLocalFileHeader(
const Poco::Path & fileName,
const Poco::DateTime & lastModifiedAt,
ZipCommon::CompressionMethod cm,
ZipCommon::CompressionLevel cl
);
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
virtual ~ZipLocalFileHeader();
Destroys the ZipLocalFileHeader.
std::string createHeader() const;
Creates a header
Poco::UInt32 getCRC() const;
Poco::UInt32 getCompressedSize() const;
ZipCommon::CompressionLevel getCompressionLevel() const;
Returns the compression level used. Only valid when the compression method is CM_DEFLATE
ZipCommon::CompressionMethod getCompressionMethod() const;
std::streamoff getDataEndPos() const;
std::streamoff getDataStartPos() const;
Returns the streamoffset for the very first byte of data. Will be equal to DataEndPos if no data present
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)
const std::string & getExtraField() const;
const std::string & getFileName() const;
Poco::UInt32 getHeaderSize() const;
Returns the total size of the header including filename + extra field size
ZipCommon::HostSystem getHostSystem() const;
int getMajorVersionNumber() const;
int getMinorVersionNumber() const;
void getRequiredVersion(
int & major,
int & minor
);
The minimum version required to extract the data
std::streamoff getStartPos() const;
Returns the position of the first byte of the header in the file stream
Poco::UInt32 getUncompressedSize() const;
bool hasData() const;
bool hasExtraField() const;
bool isDirectory() const;
bool isEncrypted() const;
bool isFile() const;
const Poco::DateTime & lastModifiedAt() const;
bool searchCRCAndSizesAfterData() const;
void setCRC(
Poco::UInt32 val
);
void setCompressedSize(
Poco::UInt32 val
);
void setFileName(
const std::string & fileName,
bool isDirectory
);
void setSearchCRCAndSizesAfterData(
bool val
);
void setStartPos(
std::streamoff start
);
Sets the start position to start and the end position to start+compressedSize
void setUncompressedSize(
Poco::UInt32 val
);
static const char HEADER[ZipCommon::HEADER_SIZE];