| OLD | NEW |
| (Empty) |
| 1 // OpenArchive.h | |
| 2 | |
| 3 #ifndef __OPENARCHIVE_H | |
| 4 #define __OPENARCHIVE_H | |
| 5 | |
| 6 #include "Common/MyString.h" | |
| 7 #include "Windows/FileFind.h" | |
| 8 | |
| 9 #include "../../Archive/IArchive.h" | |
| 10 #include "LoadCodecs.h" | |
| 11 #include "ArchiveOpenCallback.h" | |
| 12 | |
| 13 HRESULT GetArchiveItemPath(IInArchive *archive, UInt32 index, UString &result); | |
| 14 HRESULT GetArchiveItemPath(IInArchive *archive, UInt32 index, const UString &def
aultName, UString &result); | |
| 15 HRESULT GetArchiveItemFileTime(IInArchive *archive, UInt32 index, | |
| 16 const FILETIME &defaultFileTime, FILETIME &fileTime); | |
| 17 HRESULT IsArchiveItemProp(IInArchive *archive, UInt32 index, PROPID propID, bool
&result); | |
| 18 HRESULT IsArchiveItemFolder(IInArchive *archive, UInt32 index, bool &result); | |
| 19 HRESULT IsArchiveItemAnti(IInArchive *archive, UInt32 index, bool &result); | |
| 20 | |
| 21 struct ISetSubArchiveName | |
| 22 { | |
| 23 virtual void SetSubArchiveName(const wchar_t *name) = 0; | |
| 24 }; | |
| 25 | |
| 26 HRESULT OpenArchive( | |
| 27 CCodecs *codecs, | |
| 28 int arcTypeIndex, | |
| 29 IInStream *inStream, | |
| 30 const UString &fileName, | |
| 31 IInArchive **archiveResult, | |
| 32 int &formatIndex, | |
| 33 UString &defaultItemName, | |
| 34 IArchiveOpenCallback *openArchiveCallback); | |
| 35 | |
| 36 HRESULT OpenArchive( | |
| 37 CCodecs *codecs, | |
| 38 int arcTypeIndex, | |
| 39 const UString &filePath, | |
| 40 IInArchive **archive, | |
| 41 int &formatIndex, | |
| 42 UString &defaultItemName, | |
| 43 IArchiveOpenCallback *openArchiveCallback); | |
| 44 | |
| 45 HRESULT OpenArchive( | |
| 46 CCodecs *codecs, | |
| 47 const CIntVector &formatIndices, | |
| 48 const UString &filePath, | |
| 49 IInArchive **archive0, | |
| 50 IInArchive **archive1, | |
| 51 int &formatIndex0, | |
| 52 int &formatIndex1, | |
| 53 UString &defaultItemName0, | |
| 54 UString &defaultItemName1, | |
| 55 IArchiveOpenCallback *openArchiveCallback); | |
| 56 | |
| 57 | |
| 58 HRESULT ReOpenArchive(IInArchive *archive, const UString &fileName, IArchiveOpen
Callback *openArchiveCallback); | |
| 59 | |
| 60 struct CArchiveLink | |
| 61 { | |
| 62 CMyComPtr<IInArchive> Archive0; | |
| 63 CMyComPtr<IInArchive> Archive1; | |
| 64 UString DefaultItemName0; | |
| 65 UString DefaultItemName1; | |
| 66 | |
| 67 int FormatIndex0; | |
| 68 int FormatIndex1; | |
| 69 | |
| 70 UStringVector VolumePaths; | |
| 71 | |
| 72 bool IsOpen; | |
| 73 UInt64 VolumesSize; | |
| 74 | |
| 75 int GetNumLevels() const | |
| 76 { | |
| 77 int result = 0; | |
| 78 if (Archive0) | |
| 79 { | |
| 80 result++; | |
| 81 if (Archive1) | |
| 82 result++; | |
| 83 } | |
| 84 return result; | |
| 85 } | |
| 86 | |
| 87 CArchiveLink(): IsOpen(false), VolumesSize(0) {}; | |
| 88 | |
| 89 IInArchive *GetArchive() { return Archive1 != 0 ? Archive1: Archive0; } | |
| 90 UString GetDefaultItemName() { return Archive1 != 0 ? DefaultItemName1: Defau
ltItemName0; } | |
| 91 int GetArchiverIndex() const { return Archive1 != 0 ? FormatIndex1: FormatInde
x0; } | |
| 92 HRESULT Close(); | |
| 93 void Release(); | |
| 94 }; | |
| 95 | |
| 96 HRESULT OpenArchive( | |
| 97 CCodecs *codecs, | |
| 98 const CIntVector &formatIndices, | |
| 99 const UString &archiveName, | |
| 100 CArchiveLink &archiveLink, | |
| 101 IArchiveOpenCallback *openCallback); | |
| 102 | |
| 103 HRESULT MyOpenArchive( | |
| 104 CCodecs *codecs, | |
| 105 const CIntVector &formatIndices, | |
| 106 const UString &archiveName, | |
| 107 CArchiveLink &archiveLink, | |
| 108 IOpenCallbackUI *openCallbackUI); | |
| 109 | |
| 110 HRESULT ReOpenArchive( | |
| 111 CCodecs *codecs, | |
| 112 CArchiveLink &archiveLink, | |
| 113 const UString &fileName, | |
| 114 IArchiveOpenCallback *openCallback); | |
| 115 | |
| 116 #endif | |
| 117 | |
| OLD | NEW |