Eneboo - Documentación para desarrolladores
|
#include <AQZipReader.h>
Clases | |
class | FileInfo |
Tipos públicos | |
enum | Status { NoError, FileReadError, FileOpenError, FilePermissionsError, FileError } |
Métodos públicos | |
AQZipReader (const QString &fileName, uint mode=IO_ReadOnly) | |
AQZipReader (QIODevice *device) | |
~AQZipReader () | |
QIODevice * | device () const |
bool | isReadable () const |
bool | exists () const |
QValueList< FileInfo > | fileInfoList () const |
int | count () const |
FileInfo | entryInfoAt (int index) const |
QByteArray | fileData (const QString &fileName) const |
bool | extractAll (const QString &destinationDir) const |
Status | status () const |
void | close () |
FileInfo::filePath The full filepath inside the archive.
FileInfo::isDir A boolean type indicating if the entry is a directory.
FileInfo::isFile A boolean type, if it is one this entry is a file.
FileInfo::isSymLink A boolean type, if it is one this entry is symbolic link.
FileInfo::permissions A list of flags for the permissions of this entry.
FileInfo::crc32 The calculated checksum as a crc32 type.
FileInfo::size The total size of the unpacked content.
enum AQZipReader::Status |
The following status values are possible:
NoError No error occurred. FileReadError An error occurred when reading from the file. FileOpenError The file could not be opened. FilePermissionsError The file could not be accessed. FileError Another file error occurred.
Create a new zip archive that operates on the fileName. The file will be opened with the mode.
AQZipReader::AQZipReader | ( | QIODevice * | device | ) | [explicit] |
Create a new zip archive that operates on the archive found in device. You have to open the device previous to calling the constructor and only a device that is readable will be scanned for zip filecontent.
AQZipReader::~AQZipReader | ( | ) |
Desctructor
void AQZipReader::close | ( | void | ) |
Close the zip file.
int AQZipReader::count | ( | ) | const |
Return the number of items in the zip archive.
QIODevice * AQZipReader::device | ( | ) | const |
Returns device used for reading zip archive.
AQZipReader::FileInfo AQZipReader::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 AQZipReader::exists | ( | ) | const |
Returns true if the file exists; otherwise returns false.
Extracts the full contents of the zip file into destinationDir on the local filesystem. In case writing or linking a file fails, the extraction will be aborted.
QByteArray AQZipReader::fileData | ( | const QString & | fileName | ) | const |
Fetch the file contents from the zip archive and return the uncompressed bytes.
QValueList< AQZipReader::FileInfo > AQZipReader::fileInfoList | ( | ) | const |
Returns the list of files the archive contains.
bool AQZipReader::isReadable | ( | ) | const |
Returns true if the user can read the file; otherwise returns false.
AQZipReader::Status AQZipReader::status | ( | void | ) | const |
Returns a status code indicating the first error that was met by AQZipReader, or AQZipReader::NoError if no error occurred.