Example #1
0
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;
}
Example #2
0
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;
}
Example #3
0
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;
}
Example #4
0
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;
}
Example #5
0
int VSITarReader::GotoFileOffset(VSIArchiveEntryFileOffset* pOffset)
{
    VSITarEntryFileOffset* pTarEntryOffset = (VSITarEntryFileOffset*)pOffset;
    VSIFSeekL(fp, pTarEntryOffset->nOffset - 512, SEEK_SET);
    return GotoNextFile();
}
Example #6
0
int VSITarReader::GotoFirstFile()
{
    VSIFSeekL(fp, 0, SEEK_SET);
    return GotoNextFile();
}