498 qWarning() <<
"QZip: not a zip file!";
505 int num_dir_entries = 0;
507 while (start_of_directory == -1) {
509 if (pos < 0 || i > 65535) {
510 qWarning() <<
"QZip: EndOfDirectory not found";
516 if (
readUInt(eod.signature) == 0x06054b50)
522 start_of_directory =
readUInt(eod.dir_start_offset);
523 num_dir_entries =
readUShort(eod.num_dir_entries);
524 ZDEBUG(
"start_of_directory at %d, num_dir_entries=%d", start_of_directory, num_dir_entries);
525 int comment_length =
readUShort(eod.comment_length);
526 if (comment_length != i)
527 qWarning() <<
"QZip: failed to parse zip file.";
532 for (i = 0; i < num_dir_entries; ++i) {
536 qWarning() <<
"QZip: Failed to read complete header, index may be incomplete";
540 qWarning() <<
"QZip: invalid header signature, index may be incomplete";
547 qWarning() <<
"QZip: Failed to read filename from zip index, index may be incomplete";
553 qWarning() <<
"QZip: Failed to read extra field in zip file, skipping file, index may be incomplete";
559 qWarning() <<
"QZip: Failed to read read file comment, index may be incomplete";
virtual qint64 size() const
For open random-access devices, this function returns the size of the device.
Q_DECL_CONSTEXPR const T & qMin(const T &a, const T &b)
char * data()
Returns a pointer to the data stored in the byte array.
static uint readUInt(const uchar *data)
qint64 read(char *data, qint64 maxlen)
Reads at most maxSize bytes from the device into data, and returns the number of bytes read...
void append(const T &t)
Inserts value at the end of the list.
bool isOpen() const
Returns true if the device is open; otherwise returns false.
QZipReader::Status status
static ushort readUShort(const uchar *data)
Q_CORE_EXPORT void qWarning(const char *,...)
QList< FileHeader > fileHeaders
int length() const
Same as size().
OpenMode openMode() const
Returns the mode in which the device has been opened; i.e.
virtual bool open(OpenMode mode)
Opens the device and sets its OpenMode to mode.
virtual bool seek(qint64 pos)
For random-access devices, this function sets the current position to pos, returning true on success...