| 359 | } |
| 360 | |
| 361 | std::unique_ptr<IStream> ObjectAsset::GetStream() const |
| 362 | { |
| 363 | try |
| 364 | { |
| 365 | if (_zipPath.empty()) |
| 366 | { |
| 367 | return std::make_unique<FileStream>(_path, FileMode::open); |
| 368 | } |
| 369 | |
| 370 | auto zipArchive = Zip::TryOpen(_zipPath, ZipAccess::read); |
| 371 | if (zipArchive != nullptr) |
| 372 | { |
| 373 | auto stream = zipArchive->GetFileStream(_path); |
| 374 | if (stream != nullptr) |
| 375 | { |
| 376 | return std::make_unique<ZipStreamWrapper>(std::move(zipArchive), std::move(stream)); |
| 377 | } |
| 378 | } |
| 379 | } |
| 380 | catch (...) |
| 381 | { |
| 382 | } |
| 383 | return {}; |
| 384 | } |
| 385 | |
| 386 | const std::string& ObjectAsset::GetZipPath() const |
| 387 | { |
no test coverage detected