| 175 | } |
| 176 | |
| 177 | static dmResourceProvider::Result LoadManifest(dmZip::HZip zip, const char* path, dmResource::HManifest* manifest) |
| 178 | { |
| 179 | dmZip::Result zr = dmZip::OpenEntry(zip, path); |
| 180 | if (dmZip::RESULT_OK != zr) |
| 181 | { |
| 182 | dmLogError("Failed to find entry '%s'", path); |
| 183 | return dmResourceProvider::RESULT_NOT_FOUND; |
| 184 | } |
| 185 | |
| 186 | uint32_t manifest_len; |
| 187 | dmZip::GetEntrySize(zip, &manifest_len); |
| 188 | uint8_t* manifest_data = new uint8_t[manifest_len]; |
| 189 | dmZip::GetEntryData(zip, (void*)manifest_data, manifest_len); |
| 190 | dmZip::CloseEntry(zip); |
| 191 | |
| 192 | dmResourceProvider::Result result = dmResourceProvider::RESULT_OK; |
| 193 | dmResource::Result r = dmResource::LoadManifestFromBuffer(manifest_data, manifest_len, manifest); |
| 194 | if (dmResource::RESULT_OK != r) |
| 195 | { |
| 196 | dmLogError("Could not read manifest '%s' from archive", path); |
| 197 | result = dmResourceProvider::RESULT_INVAL_ERROR; |
| 198 | } |
| 199 | |
| 200 | delete[] manifest_data; |
| 201 | return result; |
| 202 | } |
| 203 | |
| 204 | static dmResourceProvider::Result Mount(const dmURI::Parts* uri, dmResourceProvider::HArchive base_archive, dmResourceProvider::HArchiveInternal* out_archive) |
| 205 | { |
no test coverage detected