MCPcopy Create free account
hub / github.com/PolyMC/PolyMC / processZIP

Function processZIP

launcher/minecraft/mod/tasks/LocalTexturePackParseTask.cpp:77–116  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

75}
76
77void processZIP(TexturePack& pack)
78{
79 Q_ASSERT(pack.type() == ResourceType::ZIPFILE);
80
81 QuaZip zip(pack.fileinfo().filePath());
82 if (!zip.open(QuaZip::mdUnzip))
83 return;
84
85 QuaZipFile file(&zip);
86
87 if (zip.setCurrentFile("pack.txt")) {
88 if (!file.open(QIODevice::ReadOnly)) {
89 qCritical() << "Failed to open file in zip.";
90 zip.close();
91 return;
92 }
93
94 auto data = file.readAll();
95
96 TexturePackUtils::processPackTXT(pack, std::move(data));
97
98 file.close();
99 }
100
101 if (zip.setCurrentFile("pack.png")) {
102 if (!file.open(QIODevice::ReadOnly)) {
103 qCritical() << "Failed to open file in zip.";
104 zip.close();
105 return;
106 }
107
108 auto data = file.readAll();
109
110 TexturePackUtils::processPackPNG(pack, std::move(data));
111
112 file.close();
113 }
114
115 zip.close();
116}
117
118void processPackTXT(TexturePack& pack, QByteArray&& raw_data)
119{

Callers 3

processFunction · 0.70

Calls 6

processPackTXTFunction · 0.85
filePathMethod · 0.80
fileinfoMethod · 0.80
openMethod · 0.80
processPackPNGFunction · 0.70
typeMethod · 0.45

Tested by

no test coverage detected