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

Method getComment

lib/QuaZip/quazip/quazip.cpp:404–423  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

402}
403
404QString QuaZip::getComment()const
405{
406 QuaZip *fakeThis=const_cast<QuaZip*>(this); // non-const
407 fakeThis->p->zipError=UNZ_OK;
408 if(p->mode!=mdUnzip) {
409 qWarning("QuaZip::getComment(): ZIP is not open in mdUnzip mode");
410 return QString();
411 }
412 unz_global_info64 globalInfo;
413 QByteArray comment;
414 if((fakeThis->p->zipError=unzGetGlobalInfo64(p->unzFile_f, &globalInfo))!=UNZ_OK)
415 return QString();
416 comment.resize(globalInfo.size_comment);
417 if((fakeThis->p->zipError=unzGetGlobalComment(p->unzFile_f, comment.data(), comment.size())) < 0)
418 return QString();
419 fakeThis->p->zipError = UNZ_OK;
420 unsigned flags = 0;
421 return (unzGetFileFlags(p->unzFile_f, &flags) == UNZ_OK) && (flags & UNZ_ENCODING_UTF8)
422 ? QString::fromUtf8(comment) : p->commentCodec->toUnicode(comment);
423}
424
425bool QuaZip::setCurrentFile(const QString& fileName, CaseSensitivity cs)
426{

Callers 3

addMethod · 0.80
setCommentCodecMethod · 0.80
zipUnzipMethod · 0.80

Calls 6

unzGetGlobalInfo64Function · 0.85
unzGetGlobalCommentFunction · 0.85
unzGetFileFlagsFunction · 0.85
resizeMethod · 0.45
dataMethod · 0.45
sizeMethod · 0.45

Tested by 3

addMethod · 0.64
setCommentCodecMethod · 0.64
zipUnzipMethod · 0.64