MCPcopy Create free account
hub / github.com/TDesktop-x64/tdesktop / ExtractZipFile

Function ExtractZipFile

Telegram/SourceFiles/storage/storage_cloud_blob.cpp:29–38  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

27}
28
29bool ExtractZipFile(zlib::FileToRead &zip, const QString path) {
30 constexpr auto kMaxSize = 25 * 1024 * 1024;
31 const auto content = zip.readCurrentFileContent(kMaxSize);
32 if (content.isEmpty() || zip.error() != UNZ_OK) {
33 return false;
34 }
35 auto file = QFile(path);
36 return file.open(QIODevice::WriteOnly)
37 && (file.write(content) == content.size());
38}
39
40} // namespace
41

Callers 1

UnpackBlobFunction · 0.85

Calls 5

isEmptyMethod · 0.45
errorMethod · 0.45
openMethod · 0.45
writeMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected