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

Method isCCZFile

native/cocos/base/ZipUtils.cpp:294–304  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

292}
293
294bool ZipUtils::isCCZFile(const char *path) {
295 // load file into memory
296 Data compressedData = FileUtils::getInstance()->getDataFromFile(path);
297
298 if (compressedData.isNull()) {
299 CC_LOG_DEBUG("ZipUtils: loading file failed");
300 return false;
301 }
302
303 return isCCZBuffer(compressedData.getBytes(), compressedData.getSize());
304}
305
306bool ZipUtils::isCCZBuffer(const unsigned char *buffer, uint32_t len) {
307 if (len < sizeof(struct CCZHeader)) {

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