UINT64 CUnzipper::GetUnzipSize() { if (muUncompressedSize == 0) { UINT64 nFile = GetFileCount(); GotoFirstFile(); while (nFile--) { UZ_FileInfo info; GetFileInfo(info); muUncompressedSize += info.dwUncompressedSize; if (!GotoNextFile()) break; } } return muUncompressedSize; }
BOOL CUnzipper::GotoFile(int nFile) { if (!m_uzFile) return FALSE; if (nFile < 0 || nFile >= GetFileCount()) return FALSE; GotoFirstFile(); while (nFile--) { if (!GotoNextFile()) return FALSE; } return TRUE; }
BOOL CUnzipper::UnzipTo(LPCTSTR szFolder, BOOL bIgnoreFilePath) { if (!m_uzFile) return FALSE; if (!szFolder || !CreateFolder(szFolder)) return FALSE; if (GetFileCount() == 0) return FALSE; if (!GotoFirstFile()) return FALSE; // else do { if (!UnzipFile(szFolder, bIgnoreFilePath)) return FALSE; } while (GotoNextFile()); return TRUE; }
BOOL CUnzipper::GotoFirstFile(LPCTSTR szChildPath) { if (!m_uzFile) return FALSE; if (!szChildPath || !lstrlen(szChildPath)) return (unzGoToFirstFile(m_uzFile) == UNZ_OK); // else if (unzGoToFirstFile(m_uzFile) == UNZ_OK) { UZ_FileInfo info; if (!GetFileInfo(info)) return FALSE; if (_tcsicmp(info.szFileName, szChildPath) == 0) return TRUE; return GotoNextFile(szChildPath); } return FALSE; }
int VSITarReader::GotoFileOffset(VSIArchiveEntryFileOffset* pOffset) { VSITarEntryFileOffset* pTarEntryOffset = (VSITarEntryFileOffset*)pOffset; VSIFSeekL(fp, pTarEntryOffset->nOffset - 512, SEEK_SET); return GotoNextFile(); }
int VSITarReader::GotoFirstFile() { VSIFSeekL(fp, 0, SEEK_SET); return GotoNextFile(); }