| 95 | |
| 96 | |
| 97 | bool ZipFile::Get(const StringImpl& fileName, Array<uint8>& data) |
| 98 | { |
| 99 | if (mData == NULL) |
| 100 | return false; |
| 101 | |
| 102 | int idx = mz_zip_reader_locate_file(&mData->mZip, fileName.c_str(), NULL, 0); |
| 103 | if (idx < 0) |
| 104 | return false; |
| 105 | |
| 106 | size_t size = 0; |
| 107 | void* ptr = mz_zip_reader_extract_to_heap(&mData->mZip, idx, &size, 0); |
| 108 | data.Insert(data.mSize, (uint8*)ptr, (intptr)size); |
| 109 | return true; |
| 110 | } |
no test coverage detected