MCPcopy Create free account
hub / github.com/assimp/assimp / MapArchive

Method MapArchive

code/Common/ZipArchiveIOSystem.cpp:405–429  ·  view source on GitHub ↗

----------------------------------------------------------------

Source from the content-addressed store, hash-verified

403
404// ----------------------------------------------------------------
405void 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// ----------------------------------------------------------------
432bool ZipArchiveIOSystem::Implement::isOpen() const {

Callers

nothing calls this directly

Calls 5

ZipFileInfoClass · 0.85
unzGoToFirstFileFunction · 0.50
unzGetCurrentFileInfoFunction · 0.50
unzGoToNextFileFunction · 0.50
emptyMethod · 0.45

Tested by

no test coverage detected