| 873 | } |
| 874 | |
| 875 | bool 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 | |
| 894 | ZipEntryInfo* ZipFile::vopen(std::string_view fileName) |
| 895 | { |
no test coverage detected