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

Method initWithData

core/base/ZipUtils.cpp:875–892  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

873}
874
875bool ZipFile::initWithData(Data data)
876{
877 if (data.isNull())
878 return false;
879 zlib_filefunc_def memory_file = {0};
880
881 std::unique_ptr<ourmemory_t> memfs(
882 new ourmemory_t{(char*)(data.getBytes()), static_cast<uint32_t>(data.getSize()), 0, 0, 0});
883 _data->memdata = std::move(data);
884 fill_memory_filefunc(&memory_file, memfs.get());
885
886 _data->zipFile = unzOpen2(nullptr, &memory_file);
887 if (!_data->zipFile)
888 return false;
889 _data->memfs = std::move(memfs);
890 setFilter(emptyFilename);
891 return true;
892}
893
894ZipEntryInfo* ZipFile::vopen(std::string_view fileName)
895{

Callers 3

addNewPageWithDataMethod · 0.45
createWithDataMethod · 0.45
engine_inj_create_lumpFunction · 0.45

Calls 6

fill_memory_filefuncFunction · 0.85
unzOpen2Function · 0.85
isNullMethod · 0.80
getBytesMethod · 0.80
getSizeMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected