MCPcopy Create free account
hub / github.com/cocos/cocos-engine / isGZipFile

Method isGZipFile

native/cocos/base/ZipUtils.cpp:315–325  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

313}
314
315bool ZipUtils::isGZipFile(const char *path) {
316 // load file into memory
317 Data compressedData = FileUtils::getInstance()->getDataFromFile(path);
318
319 if (compressedData.isNull()) {
320 CC_LOG_DEBUG("ZipUtils: loading file failed");
321 return false;
322 }
323
324 return isGZipBuffer(compressedData.getBytes(), compressedData.getSize());
325}
326
327bool ZipUtils::isGZipBuffer(const unsigned char *buffer, uint32_t len) {
328 if (len < 2) {

Callers

nothing calls this directly

Calls 4

getDataFromFileMethod · 0.80
isNullMethod · 0.45
getBytesMethod · 0.45
getSizeMethod · 0.45

Tested by

no test coverage detected