MCPcopy Create free account
hub / github.com/axmolengine/axmol / ZipFile_open_file_func

Method ZipFile_open_file_func

core/base/ZipUtils.cpp:573–586  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

571 }
572
573 static voidpf ZCALLBACK ZipFile_open_file_func(voidpf opaque, const void* filename, int mode)
574 {
575 IFileStream::Mode fsMode;
576 if ((mode & ZLIB_FILEFUNC_MODE_READWRITEFILTER) == ZLIB_FILEFUNC_MODE_READ)
577 fsMode = IFileStream::Mode::READ;
578 else if (mode & ZLIB_FILEFUNC_MODE_EXISTING)
579 fsMode = IFileStream::Mode::APPEND;
580 else if (mode & ZLIB_FILEFUNC_MODE_CREATE)
581 fsMode = IFileStream::Mode::WRITE;
582 else
583 return nullptr;
584
585 return FileUtils::getInstance()->openFileStream((const char*)filename, fsMode).release();
586 }
587
588 static voidpf ZipFile_opendisk_file_func(voidpf opaque, voidpf stream, uint32_t number_disk, int mode)
589 {

Callers

nothing calls this directly

Calls 3

getInstanceFunction · 0.85
openFileStreamMethod · 0.80
releaseMethod · 0.45

Tested by

no test coverage detected