Pages
API Documentation
On this page

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

List of all members, including inherited members

Public Functions

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.

Note: It can return nullptr

[override virtual] QByteArray KZipFileEntry::data() const

Reimplements: KArchiveFile::data() const.

Returns the content of this file.

Note: The data returned by this call is not cached.

Warning: This method loads the entire file content into memory at once. For large files or untrusted archives, this could cause excessive memory allocation. Consider reading in chunks using createDevice() instead when dealing with archives from untrusted sources.

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()

We use cookies to personalize content and to analyze our traffic. Please decide if you are willing to accept cookies from our website.