KZipFileEntry Class
Represents a file in a zip archive. More...
Header: | #include <KZipFileEntry> |
CMake: | find_package(KF6 REQUIRED COMPONENTS Archive) target_link_libraries(mytarget PRIVATE KF6::Archive) |
Inherits: | KArchiveFile |
Public Functions
KZipFileEntry(KZip *zip, const QString &name, int access, const QDateTime &date, const QString &user, const QString &group, const QString &symlink, const QString &path, qint64 start, qint64 uncompressedSize, int encoding, qint64 compressedSize) | |
qint64 | compressedSize() const |
unsigned long | crc32() const |
int | encoding() const |
qint64 | headerStart() const |
const QString & | path() const |
void | setCRC32(unsigned long crc32) |
void | setCompressedSize(qint64 compressedSize) |
void | setHeaderStart(qint64 headerstart) |
Reimplemented Public Functions
virtual QIODevice * | createDevice() const override |
virtual QByteArray | data() const override |
Detailed Description
Member Function Documentation
KZipFileEntry::KZipFileEntry(KZip *zip, const QString &name, int access, const QDateTime &date, const QString &user, const QString &group, const QString &symlink, const QString &path, qint64 start, qint64 uncompressedSize, int encoding, qint64 compressedSize)
Creates a new zip file entry. Do not call this, KZip takes care of it.
qint64 KZipFileEntry::compressedSize() const
Only used when writing
See also setCompressedSize().
unsigned long KZipFileEntry::crc32() const
CRC: only used when writing
[override virtual]
QIODevice *KZipFileEntry::createDevice() const
Reimplements: KArchiveFile::createDevice() const.
This method returns a QIODevice to read the file contents.
This is obviously for reading only.
Note that the ownership of the device is being transferred to the caller, who will have to delete it.
The returned device auto-opens (in readonly mode), no need to open it.
[override virtual]
QByteArray KZipFileEntry::data() const
Reimplements: KArchiveFile::data() const.
Returns the content of this file.
Call data() with care (only once per file), this data isn't cached.
int KZipFileEntry::encoding() const
qint64 KZipFileEntry::headerStart() const
Header start: only used when writing
See also setHeaderStart().
const QString &KZipFileEntry::path() const
Name with complete path - KArchiveFile::name() is the filename only (no path)
void KZipFileEntry::setCRC32(unsigned long crc32)
CRC: only used when writing
void KZipFileEntry::setCompressedSize(qint64 compressedSize)
Only used when writing
See also compressedSize().
void KZipFileEntry::setHeaderStart(qint64 headerstart)
Header start: only used when writing
See also headerStart().