| 501 | }; |
| 502 | |
| 503 | static la_ssize_t archiveReadVectorCallback(struct archive *a, void* client_data, const void** buffer) { |
| 504 | assert(client_data); |
| 505 | ArchiveReadVectorData* arvd = (ArchiveReadVectorData*) client_data; |
| 506 | assert(arvd->data); |
| 507 | const std::vector<uint8_t>& data = *arvd->data; |
| 508 | *buffer = &data[arvd->pos]; |
| 509 | // Read up to some block size of bytes |
| 510 | size_t len = std::min(data.size() - arvd->pos, size_t(1 << 16)); |
| 511 | arvd->pos += len; |
| 512 | return len; |
| 513 | } |
| 514 | |
| 515 | static void unarchiveToDirectory(const std::string& archivePath, const std::vector<uint8_t>* archiveData, const std::string& dirPathStr) { |
| 516 | #if defined ARCH_MAC |