| 344 | } |
| 345 | |
| 346 | std::vector<uint8_t> ObjectAsset::GetData() const |
| 347 | { |
| 348 | if (_zipPath.empty()) |
| 349 | { |
| 350 | return File::ReadAllBytes(_path); |
| 351 | } |
| 352 | |
| 353 | auto zipArchive = Zip::TryOpen(_zipPath, ZipAccess::read); |
| 354 | if (zipArchive != nullptr) |
| 355 | { |
| 356 | return zipArchive->GetFileData(_path); |
| 357 | } |
| 358 | return {}; |
| 359 | } |
| 360 | |
| 361 | std::unique_ptr<IStream> ObjectAsset::GetStream() const |
| 362 | { |