| 542 | } |
| 543 | |
| 544 | void ZipFileSystem::_init() |
| 545 | { |
| 546 | if (mInitted) |
| 547 | return; |
| 548 | mInitted = true; |
| 549 | |
| 550 | if (!mZipArchive.isNull()) |
| 551 | return; |
| 552 | if (mZipArchiveStream->getStatus() != Stream::Ok) |
| 553 | return; |
| 554 | |
| 555 | mZipArchive = new ZipArchive(); |
| 556 | if (!mZipArchive->openArchive(mZipArchiveStream, ZipArchive::Read)) |
| 557 | { |
| 558 | Con::errorf("ZipFileSystem: failed to open zip archive %s", mZipFilename.c_str()); |
| 559 | return; |
| 560 | } |
| 561 | |
| 562 | // tell the archive that it owns the zipStream now |
| 563 | mZipArchive->setDiskStream(mZipArchiveStream); |
| 564 | // and null it out because we don't own it anymore |
| 565 | mZipArchiveStream = NULL; |
| 566 | |
| 567 | // for debugging |
| 568 | //mZipArchive->dumpCentralDirectory(); |
| 569 | } |
| 570 | |
| 571 | }; |
nothing calls this directly
no test coverage detected