----------------------------------------------------------------
| 403 | |
| 404 | // ---------------------------------------------------------------- |
| 405 | void ZipArchiveIOSystem::Implement::MapArchive() { |
| 406 | if (m_ZipFileHandle == nullptr) |
| 407 | return; |
| 408 | |
| 409 | if (!m_ArchiveMap.empty()) |
| 410 | return; |
| 411 | |
| 412 | // At first ensure file is already open |
| 413 | if (unzGoToFirstFile(m_ZipFileHandle) != UNZ_OK) |
| 414 | return; |
| 415 | |
| 416 | // Loop over all files |
| 417 | do { |
| 418 | char filename[FileNameSize]; |
| 419 | unz_file_info fileInfo; |
| 420 | |
| 421 | if (unzGetCurrentFileInfo(m_ZipFileHandle, &fileInfo, filename, FileNameSize, nullptr, 0, nullptr, 0) == UNZ_OK) { |
| 422 | if (fileInfo.uncompressed_size != 0 && fileInfo.size_filename <= FileNameSize) { |
| 423 | std::string filename_string(filename, fileInfo.size_filename); |
| 424 | SimplifyFilename(filename_string); |
| 425 | m_ArchiveMap.emplace(filename_string, ZipFileInfo(m_ZipFileHandle, fileInfo.uncompressed_size)); |
| 426 | } |
| 427 | } |
| 428 | } while (unzGoToNextFile(m_ZipFileHandle) != UNZ_END_OF_LIST_OF_FILE); |
| 429 | } |
| 430 | |
| 431 | // ---------------------------------------------------------------- |
| 432 | bool ZipArchiveIOSystem::Implement::isOpen() const { |
nothing calls this directly
no test coverage detected