diff options
author | Igor Pavlov <ipavlov@users.sourceforge.net> | 2008-08-13 04:00:00 +0400 |
---|---|---|
committer | Kornel LesiĆski <kornel@geekhood.net> | 2016-05-28 02:15:56 +0300 |
commit | 173c07e166fdf6fcd20f18ea73008f1b628945df (patch) | |
tree | 13ebea85cdc4c16ae93714ff0627ee9f91ad7e08 /CPP/7zip/Archive/Chm | |
parent | 3901bf0ab88106a5b031cba7bc18d60cdebf7eef (diff) |
4.59 beta
Diffstat (limited to 'CPP/7zip/Archive/Chm')
-rwxr-xr-x | CPP/7zip/Archive/Chm/ChmHandler.cpp | 73 | ||||
-rwxr-xr-x | CPP/7zip/Archive/Chm/ChmHandler.h | 2 | ||||
-rwxr-xr-x | CPP/7zip/Archive/Chm/ChmHeader.cpp | 8 | ||||
-rwxr-xr-x | CPP/7zip/Archive/Chm/ChmIn.cpp | 96 | ||||
-rwxr-xr-x | CPP/7zip/Archive/Chm/ChmIn.h | 48 | ||||
-rwxr-xr-x | CPP/7zip/Archive/Chm/StdAfx.cpp | 3 |
6 files changed, 110 insertions, 120 deletions
diff --git a/CPP/7zip/Archive/Chm/ChmHandler.cpp b/CPP/7zip/Archive/Chm/ChmHandler.cpp index 7f3b1837..9da64bce 100755 --- a/CPP/7zip/Archive/Chm/ChmHandler.cpp +++ b/CPP/7zip/Archive/Chm/ChmHandler.cpp @@ -32,17 +32,16 @@ namespace NChm { #ifdef _CHM_DETAILS -enum +enum { kpidSection = kpidUserDefined }; #endif -STATPROPSTG kProps[] = +STATPROPSTG kProps[] = { { NULL, kpidPath, VT_BSTR}, - // { NULL, kpidIsFolder, VT_BOOL}, { NULL, kpidSize, VT_UI8}, { NULL, kpidMethod, VT_BSTR}, { NULL, kpidBlock, VT_UI4} @@ -54,7 +53,7 @@ STATPROPSTG kProps[] = #endif }; -STATPROPSTG kArcProps[] = +STATPROPSTG kArcProps[] = { { NULL, kpidNumBlocks, VT_UI8} }; @@ -71,7 +70,7 @@ STDMETHODIMP CHandler::GetArchiveProperty(PROPID propID, PROPVARIANT *value) NWindows::NCOM::CPropVariant prop; switch(propID) { - case kpidNumBlocks: + case kpidNumBlocks: { UInt64 numBlocks = 0; for (int i = 0; i < m_Database.Sections.Size(); i++) @@ -84,7 +83,7 @@ STDMETHODIMP CHandler::GetArchiveProperty(PROPID propID, PROPVARIANT *value) numBlocks += m.LzxInfo.ResetTable.GetNumBlocks(); } } - prop = numBlocks; + prop = numBlocks; break; } } @@ -132,15 +131,11 @@ STDMETHODIMP CHandler::GetProperty(UInt32 index, PROPID propID, PROPVARIANT *va } break; } - case kpidIsFolder: - prop = item.IsDirectory(); - break; - case kpidSize: - prop = item.Size; - break; + case kpidIsDir: prop = item.IsDir(); break; + case kpidSize: prop = item.Size; break; case kpidMethod: { - if (!item.IsDirectory()) + if (!item.IsDir()) if (item.Section == 0) prop = L"Copy"; else if (item.Section < m_Database.Sections.Size()) @@ -156,12 +151,8 @@ STDMETHODIMP CHandler::GetProperty(UInt32 index, PROPID propID, PROPVARIANT *va #ifdef _CHM_DETAILS - case kpidSection: - prop = (UInt32)item.Section; - break; - case kpidOffset: - prop = (UInt32)item.Offset; - break; + case kpidSection: prop = (UInt32)item.Section; break; + case kpidOffset: prop = (UInt32)item.Offset; break; #endif } @@ -170,41 +161,39 @@ STDMETHODIMP CHandler::GetProperty(UInt32 index, PROPID propID, PROPVARIANT *va COM_TRY_END } -class CPropgressImp: public CProgressVirt +class CProgressImp: public CProgressVirt { - CMyComPtr<IArchiveOpenCallback> m_OpenArchiveCallback; + CMyComPtr<IArchiveOpenCallback> _callback; public: STDMETHOD(SetTotal)(const UInt64 *numFiles); STDMETHOD(SetCompleted)(const UInt64 *numFiles); - void Init(IArchiveOpenCallback *openArchiveCallback) - { m_OpenArchiveCallback = openArchiveCallback; } + CProgressImp(IArchiveOpenCallback *callback): _callback(callback) {}; }; -STDMETHODIMP CPropgressImp::SetTotal(const UInt64 *numFiles) +STDMETHODIMP CProgressImp::SetTotal(const UInt64 *numFiles) { - if (m_OpenArchiveCallback) - return m_OpenArchiveCallback->SetCompleted(numFiles, NULL); + if (_callback) + return _callback->SetCompleted(numFiles, NULL); return S_OK; } -STDMETHODIMP CPropgressImp::SetCompleted(const UInt64 *numFiles) +STDMETHODIMP CProgressImp::SetCompleted(const UInt64 *numFiles) { - if (m_OpenArchiveCallback) - return m_OpenArchiveCallback->SetCompleted(numFiles, NULL); + if (_callback) + return _callback->SetCompleted(numFiles, NULL); return S_OK; } -STDMETHODIMP CHandler::Open(IInStream *inStream, +STDMETHODIMP CHandler::Open(IInStream *inStream, const UInt64 *maxCheckStartPosition, - IArchiveOpenCallback *openArchiveCallback) + IArchiveOpenCallback * /* openArchiveCallback */) { COM_TRY_BEGIN m_Stream.Release(); try { CInArchive archive; - CPropgressImp progressImp; - progressImp.Init(openArchiveCallback); + // CProgressImp progressImp(openArchiveCallback); RINOK(archive.Open(inStream, maxCheckStartPosition, m_Database)); /* if (m_Database.LowLevel) @@ -227,7 +216,7 @@ STDMETHODIMP CHandler::Close() return S_OK; } -class CChmFolderOutStream: +class CChmFolderOutStream: public ISequentialOutStream, public CMyUnknownImp { @@ -280,7 +269,7 @@ void CChmFolderOutStream::Init( HRESULT CChmFolderOutStream::OpenFile() { - Int32 askMode = (*m_ExtractStatuses)[m_CurrentIndex] ? (m_TestMode ? + Int32 askMode = (*m_ExtractStatuses)[m_CurrentIndex] ? (m_TestMode ? NExtract::NAskMode::kTest : NExtract::NAskMode::kExtract) : NExtract::NAskMode::kSkip; @@ -345,7 +334,7 @@ HRESULT CChmFolderOutStream::Write2(const void *data, UInt32 size, UInt32 *proce { m_RealOutStream.Release(); RINOK(m_ExtractCallback->SetOperationResult( - m_IsOk ? + m_IsOk ? NArchive::NExtract::NOperationResult::kOK: NArchive::NExtract::NOperationResult::kDataError)); m_FileIsOpen = false; @@ -356,7 +345,7 @@ HRESULT CChmFolderOutStream::Write2(const void *data, UInt32 size, UInt32 *proce else { if (m_CurrentIndex >= m_NumFiles) - return E_FAIL; + return E_FAIL; int fullIndex = m_StartIndex + m_CurrentIndex; m_RemainFileSize = m_Database->GetFileSize(fullIndex); UInt64 fileOffset = m_Database->GetFileOffset(fullIndex); @@ -458,7 +447,7 @@ STDMETHODIMP CHandler::Extract(const UInt32* indices, UInt32 numItems, RINOK(lps->SetCur()); CMyComPtr<ISequentialOutStream> realOutStream; - Int32 askMode= testMode ? + Int32 askMode= testMode ? NArchive::NExtract::NAskMode::kTest : NArchive::NExtract::NAskMode::kExtract; Int32 index = allFilesMode ? i : indices[i]; @@ -502,7 +491,7 @@ STDMETHODIMP CHandler::Extract(const UInt32* indices, UInt32 numItems, RINOK(copyCoder->Code(inStream, realOutStream, NULL, NULL, progress)); realOutStream.Release(); - RINOK(extractCallback->SetOperationResult((copyCoderSpec->TotalSize == item.Size) ? + RINOK(extractCallback->SetOperationResult((copyCoderSpec->TotalSize == item.Size) ? NArchive::NExtract::NOperationResult::kOK: NArchive::NExtract::NOperationResult::kDataError)); } @@ -516,7 +505,7 @@ STDMETHODIMP CHandler::Extract(const UInt32* indices, UInt32 numItems, int entryIndex = m_Database.Indices[index]; const CItem &item = m_Database.Items[entryIndex]; UInt64 sectionIndex = item.Section; - if (item.IsDirectory() || item.Size == 0) + if (item.IsDir() || item.Size == 0) continue; if (sectionIndex == 0) { @@ -554,10 +543,10 @@ STDMETHODIMP CHandler::Extract(const UInt32* indices, UInt32 numItems, int entryIndex = m_Database.Indices[index]; const CItem &item = m_Database.Items[entryIndex]; UInt64 sectionIndex = item.Section; - Int32 askMode= testMode ? + Int32 askMode= testMode ? NArchive::NExtract::NAskMode::kTest : NArchive::NExtract::NAskMode::kExtract; - if (item.IsDirectory()) + if (item.IsDir()) { CMyComPtr<ISequentialOutStream> realOutStream; RINOK(extractCallback->GetStream(index, &realOutStream, askMode)); diff --git a/CPP/7zip/Archive/Chm/ChmHandler.h b/CPP/7zip/Archive/Chm/ChmHandler.h index 09113b8f..440c50f1 100755 --- a/CPP/7zip/Archive/Chm/ChmHandler.h +++ b/CPP/7zip/Archive/Chm/ChmHandler.h @@ -10,7 +10,7 @@ namespace NArchive { namespace NChm { -class CHandler: +class CHandler: public IInArchive, public CMyUnknownImp { diff --git a/CPP/7zip/Archive/Chm/ChmHeader.cpp b/CPP/7zip/Archive/Chm/ChmHeader.cpp index 4d485b6c..e8dc9f3e 100755 --- a/CPP/7zip/Archive/Chm/ChmHeader.cpp +++ b/CPP/7zip/Archive/Chm/ChmHeader.cpp @@ -11,11 +11,11 @@ namespace NHeader{ UInt32 kItsfSignature = 0x46535449 + 1; UInt32 kItolSignature = 0x4C4F5449 + 1; static class CSignatureInitializer -{ -public: +{ +public: CSignatureInitializer() - { - kItsfSignature--; + { + kItsfSignature--; kItolSignature--; } }g_SignatureInitializer; diff --git a/CPP/7zip/Archive/Chm/ChmIn.cpp b/CPP/7zip/Archive/Chm/ChmIn.cpp index 5e13f54b..1379b1fd 100755 --- a/CPP/7zip/Archive/Chm/ChmIn.cpp +++ b/CPP/7zip/Archive/Chm/ChmIn.cpp @@ -17,16 +17,16 @@ namespace NChm{ // define CHM_LOW, if you want to see low level items // #define CHM_LOW -static const GUID kChmLzxGuid = +static const GUID kChmLzxGuid = { 0x7FC28940, 0x9D31, 0x11D0, 0x9B, 0x27, 0x00, 0xA0, 0xC9, 0x1E, 0x9C, 0x7C }; -static const GUID kHelp2LzxGuid = +static const GUID kHelp2LzxGuid = { 0x0A9007C6, 0x4076, 0x11D3, 0x87, 0x89, 0x00, 0x00, 0xF8, 0x10, 0x57, 0x54 }; -static const GUID kDesGuid = +static const GUID kDesGuid = { 0x67F6E4A2, 0x60BF, 0x11D3, 0x85, 0x40, 0x00, 0xC0, 0x4F, 0x58, 0xC3, 0xCF }; static bool AreGuidsEqual(REFGUID g1, REFGUID g2) -{ - if (g1.Data1 != g2.Data1 || +{ + if (g1.Data1 != g2.Data1 || g1.Data2 != g2.Data2 || g1.Data3 != g2.Data3) return false; @@ -60,7 +60,7 @@ static void PrintUInt32(UInt32 v, AString &s) } AString CMethodInfo::GetGuidString() const -{ +{ AString s; s += '{'; PrintUInt32(Guid.Data1, s); @@ -278,9 +278,9 @@ HRESULT CInArchive::OpenChm(IInStream *inStream, CDatabase &database) if (unknown1 != 0 && unknown1 != 1) // it's 0 in one .sll file return S_FALSE; /* UInt32 timeStamp = */ ReadUInt32(); - // Considered as a big-endian DWORD, it appears to contain seconds (MSB) and - // fractional seconds (second byte). - // The third and fourth bytes may contain even more fractional bits. + // Considered as a big-endian DWORD, it appears to contain seconds (MSB) and + // fractional seconds (second byte). + // The third and fourth bytes may contain even more fractional bits. // The 4 least significant bits in the last byte are constant. /* UInt32 lang = */ ReadUInt32(); GUID g; @@ -326,12 +326,12 @@ HRESULT CInArchive::OpenChm(IInStream *inStream, CDatabase &database) if (dirChunkSize < 32) return S_FALSE; /* UInt32 density = */ ReadUInt32(); // "Density" of quickref section, usually 2. - /* UInt32 depth = */ ReadUInt32(); // Depth of the index tree: 1 there is no index, + /* UInt32 depth = */ ReadUInt32(); // Depth of the index tree: 1 there is no index, // 2 if there is one level of PMGI chunks. /* UInt32 chunkNumber = */ ReadUInt32(); // Chunk number of root index chunk, -1 if there is none - // (though at least one file has 0 despite there being no - // index chunk, probably a bug.) + // (though at least one file has 0 despite there being no + // index chunk, probably a bug.) /* UInt32 firstPmglChunkNumber = */ ReadUInt32(); // Chunk number of first PMGL (listing) chunk /* UInt32 lastPmglChunkNumber = */ ReadUInt32(); // Chunk number of last PMGL (listing) chunk ReadUInt32(); // -1 (unknown) @@ -348,11 +348,11 @@ HRESULT CInArchive::OpenChm(IInStream *inStream, CDatabase &database) UInt64 chunkPos = _inBuffer.GetProcessedSize(); if (ReadUInt32() == NHeader::kPmglSignature) { - // The quickref area is written backwards from the end of the chunk. - // One quickref entry exists for every n entries in the file, where n - // is calculated as 1 + (1 << quickref density). So for density = 2, n = 5. + // The quickref area is written backwards from the end of the chunk. + // One quickref entry exists for every n entries in the file, where n + // is calculated as 1 + (1 << quickref density). So for density = 2, n = 5. - UInt32 quickrefLength = ReadUInt32(); // Length of free space and/or quickref area at end of directory chunk + UInt32 quickrefLength = ReadUInt32(); // Length of free space and/or quickref area at end of directory chunk if (quickrefLength > dirChunkSize || quickrefLength < 2) return S_FALSE; ReadUInt32(); // Always 0 @@ -393,10 +393,10 @@ HRESULT CInArchive::OpenHelp2(IInStream *inStream, CDatabase &database) if (numHeaderSections != kNumHeaderSectionsMax) return S_FALSE; ReadUInt32(); // Length of post-header table - GUID g; + GUID g; ReadGUID(g); // {0A9007C1-4076-11D3-8789-0000F8105754} - // header section table + // header section table UInt64 sectionOffsets[kNumHeaderSectionsMax]; UInt64 sectionSizes[kNumHeaderSectionsMax]; UInt32 i; @@ -434,9 +434,9 @@ HRESULT CInArchive::OpenHelp2(IInStream *inStream, CDatabase &database) ReadUInt64(); // Number of directory index entries (same as number of AOLL // chunks in main directory) - // (The obvious guess for the following two fields, which recur in a number - // of places, is they are maximum sizes for the directory and directory index. - // However, I have seen no direct evidence that this is the case.) + // (The obvious guess for the following two fields, which recur in a number + // of places, is they are maximum sizes for the directory and directory index. + // However, I have seen no direct evidence that this is the case.) ReadUInt32(); // $100000 (Same as field following chunk size in directory) ReadUInt32(); // $20000 (Same as field following chunk size in directory index) @@ -480,8 +480,8 @@ HRESULT CInArchive::OpenHelp2(IInStream *inStream, CDatabase &database) if (unknown != 0 && unknown != 1) // = 0 for some HxW files, 1 in other cases; return S_FALSE; database.ContentOffset = _startPosition + ReadUInt64(); - /* UInt32 timeStamp = */ ReadUInt32(); - // A timestamp of some sort. + /* UInt32 timeStamp = */ ReadUInt32(); + // A timestamp of some sort. // Considered as a big-endian DWORD, it appears to contain // seconds (MSB) and fractional seconds (second byte). // The third and fourth bytes may contain even more fractional @@ -527,7 +527,7 @@ HRESULT CInArchive::OpenHelp2(IInStream *inStream, CDatabase &database) UInt32 quickrefLength = ReadUInt32(); // Length of quickref area at end of directory chunk if (quickrefLength > dirChunkSize || quickrefLength < 2) return S_FALSE; - ReadUInt64(); // Directory chunk number + ReadUInt64(); // Directory chunk number // This must match physical position in file, that is // the chunk size times the chunk number must be the // offset from the end of the directory header. @@ -625,8 +625,8 @@ static int CompareFiles(const int *p1, const int *p2, void *param) const CObjectVector<CItem> &items = *(const CObjectVector<CItem> *)param; const CItem &item1 = items[*p1]; const CItem &item2 = items[*p2]; - bool isDir1 = item1.IsDirectory(); - bool isDir2 = item2.IsDirectory(); + bool isDir1 = item1.IsDir(); + bool isDir2 = item2.IsDir(); if (isDir1 && !isDir2) return -1; if (isDir2) @@ -663,7 +663,7 @@ bool CFilesDatabase::Check() for(int i = 0; i < Indices.Size(); i++) { const CItem &item = Items[Indices[i]]; - if (item.Section == 0 || item.IsDirectory()) + if (item.Section == 0 || item.IsDir()) continue; if (item.Section != prevSection) { @@ -718,7 +718,7 @@ HRESULT CInArchive::OpenHighLevel(IInStream *inStream, CFilesDatabase &database) AString transformPrefix = sectionPrefix + kTransform; if (database.Help2Format) { - // Transform List + // Transform List RINOK(DecompressStream(inStream, database, transformPrefix + kTransformList)); if ((_chunkSize & 0xF) != 0) return S_FALSE; @@ -760,21 +760,21 @@ HRESULT CInArchive::OpenHighLevel(IInStream *inStream, CFilesDatabase &database) li.WindowSize = ReadUInt32(); li.CacheSize = ReadUInt32(); if ( - li.ResetInterval != 1 && - li.ResetInterval != 2 && - li.ResetInterval != 4 && - li.ResetInterval != 8 && - li.ResetInterval != 16 && - li.ResetInterval != 32 && + li.ResetInterval != 1 && + li.ResetInterval != 2 && + li.ResetInterval != 4 && + li.ResetInterval != 8 && + li.ResetInterval != 16 && + li.ResetInterval != 32 && li.ResetInterval != 64) return S_FALSE; if ( - li.WindowSize != 1 && - li.WindowSize != 2 && - li.WindowSize != 4 && - li.WindowSize != 8 && - li.WindowSize != 16 && - li.WindowSize != 32 && + li.WindowSize != 1 && + li.WindowSize != 2 && + li.WindowSize != 4 && + li.WindowSize != 8 && + li.WindowSize != 16 && + li.WindowSize != 32 && li.WindowSize != 64) return S_FALSE; numDWORDS -= 5; @@ -803,7 +803,7 @@ HRESULT CInArchive::OpenHighLevel(IInStream *inStream, CFilesDatabase &database) if (method.IsLzx()) { // ResetTable; - RINOK(DecompressStream(inStream, database, transformPrefix + + RINOK(DecompressStream(inStream, database, transformPrefix + method.GetGuidString() + kResetTable)); CResetTable &rt = method.LzxInfo.ResetTable; if (_chunkSize < 4) @@ -845,7 +845,7 @@ HRESULT CInArchive::OpenHighLevel(IInStream *inStream, CFilesDatabase &database) return database.Check() ? S_OK : S_FALSE; } -HRESULT CInArchive::Open2(IInStream *inStream, +HRESULT CInArchive::Open2(IInStream *inStream, const UInt64 *searchHeaderSizeLimit, CFilesDatabase &database) { @@ -864,6 +864,11 @@ HRESULT CInArchive::Open2(IInStream *inStream, const int kSignatureSize = 8; UInt64 hxsSignature = NHeader::GetHxsSignature(); UInt64 chmSignature = ((UInt64)chmVersion << 32)| NHeader::kItsfSignature; + UInt64 limit = 1 << 18; + if (searchHeaderSizeLimit) + if (limit > *searchHeaderSizeLimit) + limit = *searchHeaderSizeLimit; + for (;;) { Byte b; @@ -880,9 +885,8 @@ HRESULT CInArchive::Open2(IInStream *inStream, database.Help2Format = true; break; } - if (searchHeaderSizeLimit != NULL) - if (_inBuffer.GetProcessedSize() > (*searchHeaderSizeLimit)) - return S_FALSE; + if (_inBuffer.GetProcessedSize() > limit) + return S_FALSE; } } _startPosition += _inBuffer.GetProcessedSize() - kSignatureSize; @@ -919,7 +923,7 @@ HRESULT CInArchive::Open2(IInStream *inStream, return S_OK; } -HRESULT CInArchive::Open(IInStream *inStream, +HRESULT CInArchive::Open(IInStream *inStream, const UInt64 *searchHeaderSizeLimit, CFilesDatabase &database) { diff --git a/CPP/7zip/Archive/Chm/ChmIn.h b/CPP/7zip/Archive/Chm/ChmIn.h index e677c618..943336cb 100755 --- a/CPP/7zip/Archive/Chm/ChmIn.h +++ b/CPP/7zip/Archive/Chm/ChmIn.h @@ -19,21 +19,21 @@ struct CItem UInt64 Size; AString Name; - bool IsFormatRelatedItem() const + bool IsFormatRelatedItem() const { if (Name.Length() < 2) return false; return Name[0] == ':' && Name[1] == ':'; } - bool IsUserItem() const + bool IsUserItem() const { if (Name.Length() < 2) return false; return Name[0] == '/'; } - bool IsDirectory() const + bool IsDir() const { if (Name.Length() == 0) return false; @@ -57,12 +57,12 @@ struct CDatabase return -1; } - void Clear() - { + void Clear() + { NewFormat = false; NewFormatString.Empty(); Help2Format = false; - Items.Clear(); + Items.Clear(); } }; @@ -72,7 +72,7 @@ struct CResetTable UInt64 CompressedSize; UInt64 BlockSize; CRecordVector<UInt64> ResetOffsets; - bool GetCompressedSizeOfBlocks(UInt64 blockIndex, UInt32 numBlocks, UInt64 &size) const + bool GetCompressedSizeOfBlocks(UInt64 blockIndex, UInt32 numBlocks, UInt64 &size) const { if (blockIndex >= ResetOffsets.Size()) return false; @@ -83,11 +83,11 @@ struct CResetTable size = ResetOffsets[(int)(blockIndex + numBlocks)] - startPos; return true; } - bool GetCompressedSizeOfBlock(UInt64 blockIndex, UInt64 &size) const + bool GetCompressedSizeOfBlock(UInt64 blockIndex, UInt64 &size) const { return GetCompressedSizeOfBlocks(blockIndex, 1, size); } - UInt64 GetNumBlocks(UInt64 size) const + UInt64 GetNumBlocks(UInt64 size) const { return (size + BlockSize - 1) / BlockSize; } @@ -116,16 +116,16 @@ struct CLzxInfo UInt64 GetFolder(UInt64 offset) const { return offset / GetFolderSize(); }; UInt64 GetFolderPos(UInt64 folderIndex) const { return folderIndex * GetFolderSize(); }; UInt64 GetBlockIndexFromFolderIndex(UInt64 folderIndex) const { return folderIndex * ResetInterval; }; - bool GetOffsetOfFolder(UInt64 folderIndex, UInt64 &offset) const - { + bool GetOffsetOfFolder(UInt64 folderIndex, UInt64 &offset) const + { UInt64 blockIndex = GetBlockIndexFromFolderIndex(folderIndex); if (blockIndex >= ResetTable.ResetOffsets.Size()) return false; offset = ResetTable.ResetOffsets[(int)blockIndex]; return true; } - bool GetCompressedSizeOfFolder(UInt64 folderIndex, UInt64 &size) const - { + bool GetCompressedSizeOfFolder(UInt64 folderIndex, UInt64 &size) const + { UInt64 blockIndex = GetBlockIndexFromFolderIndex(folderIndex); return ResetTable.GetCompressedSizeOfBlocks(blockIndex, ResetInterval, size); } @@ -165,8 +165,8 @@ public: UInt64 GetFileSize(int fileIndex) const { return Items[Indices[fileIndex]].Size; } UInt64 GetFileOffset(int fileIndex) const { return Items[Indices[fileIndex]].Offset; } - UInt64 GetFolder(int fileIndex) const - { + UInt64 GetFolder(int fileIndex) const + { const CItem &item = Items[Indices[fileIndex]]; const CSectionInfo §ion = Sections[(int)item.Section]; if (section.IsLzx()) @@ -174,8 +174,8 @@ public: return 0; } - UInt64 GetLastFolder(int fileIndex) const - { + UInt64 GetLastFolder(int fileIndex) const + { const CItem &item = Items[Indices[fileIndex]]; const CSectionInfo §ion = Sections[(int)item.Section]; if (section.IsLzx()) @@ -183,16 +183,16 @@ public: return 0; } - void HighLevelClear() - { + void HighLevelClear() + { LowLevel = true; - Indices.Clear(); - Sections.Clear(); + Indices.Clear(); + Sections.Clear(); } - void Clear() - { - CDatabase::Clear(); + void Clear() + { + CDatabase::Clear(); HighLevelClear(); } void SetIndices(); diff --git a/CPP/7zip/Archive/Chm/StdAfx.cpp b/CPP/7zip/Archive/Chm/StdAfx.cpp deleted file mode 100755 index d0feea85..00000000 --- a/CPP/7zip/Archive/Chm/StdAfx.cpp +++ /dev/null @@ -1,3 +0,0 @@ -// StdAfx.cpp - -#include "StdAfx.h" |