MCPcopy Create free account
hub / github.com/Serial-Studio/Serial-Studio / close

Method close

lib/QuaZip/quazip/quazipfile.cpp:469–492  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

467}
468
469void 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
494qint64 QuaZipFile::readData(char *data, qint64 maxSize)
495{

Callers 1

openMethod · 0.45

Calls 9

unzCloseCurrentFileFunction · 0.85
zipCloseFileInZipRaw64Function · 0.85
zipCloseFileInZipFunction · 0.85
resetZipErrorMethod · 0.80
setZipErrorMethod · 0.80
getUnzFileMethod · 0.80
getZipFileMethod · 0.80
isOpenMethod · 0.45
getZipErrorMethod · 0.45

Tested by

no test coverage detected