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

Method getCurrentFileName

lib/QuaZip/quazip/quazip.cpp:567–589  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

565}
566
567QString QuaZip::getCurrentFileName()const
568{
569 QuaZip *fakeThis=const_cast<QuaZip*>(this); // non-const
570 fakeThis->p->zipError=UNZ_OK;
571 if(p->mode!=mdUnzip) {
572 qWarning("QuaZip::getCurrentFileName(): ZIP is not open in mdUnzip mode");
573 return QString();
574 }
575 if(!isOpen()||!hasCurrentFile()) return QString();
576 QByteArray fileName(MAX_FILE_NAME_LENGTH, 0);
577 unz_file_info64 file_info;
578 if((fakeThis->p->zipError=unzGetCurrentFileInfo64(p->unzFile_f, &file_info, fileName.data(), fileName.size(),
579 nullptr, 0, nullptr, 0))!=UNZ_OK)
580 return QString();
581 fileName.resize(file_info.size_filename);
582 QString result = (file_info.flag & UNZ_ENCODING_UTF8)
583 ? QString::fromUtf8(fileName) : p->fileNameCodec->toUnicode(fileName);
584 if (result.isEmpty())
585 return result;
586 // Add to directory map
587 p->addCurrentFileToDirectoryMap(result);
588 return result;
589}
590
591void QuaZip::setFileNameCodec(QTextCodec *fileNameCodec)
592{

Callers 7

getFileListMethod · 0.80
extractDirMethod · 0.80
entryInfoListMethod · 0.80
getActualFileNameMethod · 0.80
QuaZip_getFileInfoFunction · 0.80
getFileInfoListMethod · 0.80

Calls 6

unzGetCurrentFileInfo64Function · 0.85
isEmptyMethod · 0.80
dataMethod · 0.45
sizeMethod · 0.45
resizeMethod · 0.45

Tested by 1

getFileListMethod · 0.64