| 467 | } |
| 468 | |
| 469 | void QuaZipFile::close() |
| 470 | { |
| 471 | p->resetZipError(); |
| 472 | if(p->zip==nullptr||!p->zip->isOpen()) return; |
| 473 | if(!isOpen()) { |
| 474 | qWarning("QuaZipFile::close(): file isn't open"); |
| 475 | return; |
| 476 | } |
| 477 | if(openMode()&ReadOnly) |
| 478 | p->setZipError(unzCloseCurrentFile(p->zip->getUnzFile())); |
| 479 | else if(openMode()&WriteOnly) |
| 480 | if(isRaw()) p->setZipError(zipCloseFileInZipRaw64(p->zip->getZipFile(), p->uncompressedSize, p->crc)); |
| 481 | else p->setZipError(zipCloseFileInZip(p->zip->getZipFile())); |
| 482 | else { |
| 483 | qWarning("Wrong open mode: %d", (int)openMode()); |
| 484 | return; |
| 485 | } |
| 486 | if(p->zipError==UNZ_OK) setOpenMode(QIODevice::NotOpen); |
| 487 | else return; |
| 488 | if(p->internal) { |
| 489 | p->zip->close(); |
| 490 | p->setZipError(p->zip->getZipError()); |
| 491 | } |
| 492 | } |
| 493 | |
| 494 | qint64 QuaZipFile::readData(char *data, qint64 maxSize) |
| 495 | { |
no test coverage detected