![]() |
Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
|
\variable QZipReader::FileInfo::filePath The full filepath inside the archive. More...
#include <qzipreader_p.h>
Classes | |
class | FileInfo |
Public Types | |
enum | Status { NoError , FileReadError , FileOpenError , FilePermissionsError , FileError } |
The following status values are possible: More... |
Public Member Functions | |
QZipReader (const QString &fileName, QIODevice::OpenMode mode=QIODevice::ReadOnly) | |
Create a new zip archive that operates on the fileName. | |
QZipReader (QIODevice *device) | |
Create a new zip archive that operates on the archive found in device. | |
~QZipReader () | |
Destructor. | |
QIODevice * | device () const |
Returns device used for reading zip archive. | |
bool | isReadable () const |
Returns true if the user can read the file; otherwise returns false . | |
bool | exists () const |
Returns true if the file exists; otherwise returns false . | |
QList< FileInfo > | fileInfoList () const |
Returns the list of files the archive contains. | |
int | count () const |
Return the number of items in the zip archive. | |
FileInfo | entryInfoAt (int index) const |
Returns a FileInfo of an entry in the zipfile. | |
QByteArray | fileData (const QString &fileName) const |
Fetch the file contents from the zip archive and return the uncompressed bytes. | |
bool | extractAll (const QString &destinationDir) const |
Extracts the full contents of the zip file into destinationDir on the local filesystem. | |
Status | status () const |
Returns a status code indicating the first error that was met by QZipReader, or QZipReader::NoError if no error occurred. | |
void | close () |
Close the zip file. |
\variable QZipReader::FileInfo::filePath The full filepath inside the archive.
\variable QZipReader::FileInfo::isDir A boolean type indicating if the entry is a directory.
\variable QZipReader::FileInfo::isFile A boolean type, if it is one this entry is a file.
\variable QZipReader::FileInfo::isSymLink A boolean type, if it is one this entry is symbolic link.
\variable QZipReader::FileInfo::permissions A list of flags for the permissions of this entry.
\variable QZipReader::FileInfo::crc The calculated checksum as a crc type.
\variable QZipReader::FileInfo::size The total size of the unpacked content.
the QZipReader class provides a way to inspect the contents of a zip archive and extract individual files from it.
QZipReader can be used to read a zip archive either from a file or from any device. An in-memory QBuffer for instance. The reader can be used to read which files are in the archive using fileInfoList() and entryInfoAt() but also to extract individual files using fileData() or even to extract all files in the archive using extractAll()
Definition at line 29 of file qzipreader_p.h.
enum QZipReader::Status |
The following status values are possible:
\value NoError No error occurred. \value FileReadError An error occurred when reading from the file. \value FileOpenError The file could not be opened. \value FilePermissionsError The file could not be accessed. \value FileError Another file error occurred.
Enumerator | |
---|---|
NoError | |
FileReadError | |
FileOpenError | |
FilePermissionsError | |
FileError |
Definition at line 67 of file qzipreader_p.h.
|
explicit |
|
explicit |
int QZipReader::count | ( | ) | const |
QIODevice * QZipReader::device | ( | ) | const |
QZipReader::FileInfo QZipReader::entryInfoAt | ( | int | index | ) | const |
Returns a FileInfo of an entry in the zipfile.
The index is the index into the directory listing of the zipfile. Returns an invalid FileInfo if index is out of boundaries.
bool QZipReader::exists | ( | ) | const |
bool QZipReader::extractAll | ( | const QString & | destinationDir | ) | const |
QByteArray QZipReader::fileData | ( | const QString & | fileName | ) | const |
QList< QZipReader::FileInfo > QZipReader::fileInfoList | ( | ) | const |
bool QZipReader::isReadable | ( | ) | const |
QZipReader::Status QZipReader::status | ( | ) | const |
Returns a status code indicating the first error that was met by QZipReader, or QZipReader::NoError if no error occurred.