other-licenses/7zstub/src/7zip/Archive/IArchive.h

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

michael@0 1 // IArchive.h
michael@0 2
michael@0 3 #ifndef __IARCHIVE_H
michael@0 4 #define __IARCHIVE_H
michael@0 5
michael@0 6 #include "../IStream.h"
michael@0 7 #include "../IProgress.h"
michael@0 8 #include "../PropID.h"
michael@0 9
michael@0 10 // MIDL_INTERFACE("23170F69-40C1-278A-0000-000600xx0000")
michael@0 11 #define ARCHIVE_INTERFACE_SUB(i, base, x) \
michael@0 12 DEFINE_GUID(IID_ ## i, \
michael@0 13 0x23170F69, 0x40C1, 0x278A, 0x00, 0x00, 0x00, 0x06, 0x00, x, 0x00, 0x00); \
michael@0 14 struct i: public base
michael@0 15
michael@0 16 #define ARCHIVE_INTERFACE(i, x) ARCHIVE_INTERFACE_SUB(i, IUnknown, x)
michael@0 17
michael@0 18 namespace NFileTimeType
michael@0 19 {
michael@0 20 enum EEnum
michael@0 21 {
michael@0 22 kWindows,
michael@0 23 kUnix,
michael@0 24 kDOS
michael@0 25 };
michael@0 26 }
michael@0 27
michael@0 28 namespace NArchive
michael@0 29 {
michael@0 30 enum
michael@0 31 {
michael@0 32 kName = 0,
michael@0 33 kClassID,
michael@0 34 kExtension,
michael@0 35 kAddExtension,
michael@0 36 kUpdate,
michael@0 37 kKeepName,
michael@0 38 kStartSignature,
michael@0 39 kFinishSignature,
michael@0 40 kAssociate
michael@0 41 };
michael@0 42
michael@0 43 namespace NExtract
michael@0 44 {
michael@0 45 namespace NAskMode
michael@0 46 {
michael@0 47 enum
michael@0 48 {
michael@0 49 kExtract = 0,
michael@0 50 kTest,
michael@0 51 kSkip,
michael@0 52 };
michael@0 53 }
michael@0 54 namespace NOperationResult
michael@0 55 {
michael@0 56 enum
michael@0 57 {
michael@0 58 kOK = 0,
michael@0 59 kUnSupportedMethod,
michael@0 60 kDataError,
michael@0 61 kCRCError,
michael@0 62 };
michael@0 63 }
michael@0 64 }
michael@0 65 namespace NUpdate
michael@0 66 {
michael@0 67 namespace NOperationResult
michael@0 68 {
michael@0 69 enum
michael@0 70 {
michael@0 71 kOK = 0,
michael@0 72 kError,
michael@0 73 };
michael@0 74 }
michael@0 75 }
michael@0 76 }
michael@0 77
michael@0 78 ARCHIVE_INTERFACE(IArchiveOpenCallback, 0x10)
michael@0 79 {
michael@0 80 STDMETHOD(SetTotal)(const UInt64 *files, const UInt64 *bytes) PURE;
michael@0 81 STDMETHOD(SetCompleted)(const UInt64 *files, const UInt64 *bytes) PURE;
michael@0 82 };
michael@0 83
michael@0 84
michael@0 85 ARCHIVE_INTERFACE_SUB(IArchiveExtractCallback, IProgress, 0x20)
michael@0 86 {
michael@0 87 STDMETHOD(GetStream)(UInt32 index, ISequentialOutStream **outStream,
michael@0 88 Int32 askExtractMode) PURE;
michael@0 89 // GetStream OUT: S_OK - OK, S_FALSE - skeep this file
michael@0 90 STDMETHOD(PrepareOperation)(Int32 askExtractMode) PURE;
michael@0 91 STDMETHOD(SetOperationResult)(Int32 resultEOperationResult) PURE;
michael@0 92 };
michael@0 93
michael@0 94
michael@0 95 ARCHIVE_INTERFACE(IArchiveOpenVolumeCallback, 0x30)
michael@0 96 {
michael@0 97 STDMETHOD(GetProperty)(PROPID propID, PROPVARIANT *value) PURE;
michael@0 98 STDMETHOD(GetStream)(const wchar_t *name, IInStream **inStream) PURE;
michael@0 99 };
michael@0 100
michael@0 101
michael@0 102 ARCHIVE_INTERFACE(IInArchiveGetStream, 0x40)
michael@0 103 {
michael@0 104 STDMETHOD(GetStream)(UInt32 index, ISequentialInStream **stream) PURE;
michael@0 105 };
michael@0 106
michael@0 107
michael@0 108 ARCHIVE_INTERFACE(IArchiveOpenSetSubArchiveName, 0x50)
michael@0 109 {
michael@0 110 STDMETHOD(SetSubArchiveName)(const wchar_t *name) PURE;
michael@0 111 };
michael@0 112
michael@0 113
michael@0 114 ARCHIVE_INTERFACE(IInArchive, 0x60)
michael@0 115 {
michael@0 116 STDMETHOD(Open)(IInStream *stream, const UInt64 *maxCheckStartPosition,
michael@0 117 IArchiveOpenCallback *openArchiveCallback) PURE;
michael@0 118 STDMETHOD(Close)() PURE;
michael@0 119 STDMETHOD(GetNumberOfItems)(UInt32 *numItems) PURE;
michael@0 120 STDMETHOD(GetProperty)(UInt32 index, PROPID propID, PROPVARIANT *value) PURE;
michael@0 121 STDMETHOD(Extract)(const UInt32* indices, UInt32 numItems,
michael@0 122 Int32 testMode, IArchiveExtractCallback *extractCallback) PURE;
michael@0 123 // indices must be sorted
michael@0 124 // numItems = 0xFFFFFFFF means all files
michael@0 125 // testMode != 0 means "test files operation"
michael@0 126
michael@0 127 STDMETHOD(GetArchiveProperty)(PROPID propID, PROPVARIANT *value) PURE;
michael@0 128
michael@0 129 STDMETHOD(GetNumberOfProperties)(UInt32 *numProperties) PURE;
michael@0 130 STDMETHOD(GetPropertyInfo)(UInt32 index,
michael@0 131 BSTR *name, PROPID *propID, VARTYPE *varType) PURE;
michael@0 132
michael@0 133 STDMETHOD(GetNumberOfArchiveProperties)(UInt32 *numProperties) PURE;
michael@0 134 STDMETHOD(GetArchivePropertyInfo)(UInt32 index,
michael@0 135 BSTR *name, PROPID *propID, VARTYPE *varType) PURE;
michael@0 136 };
michael@0 137
michael@0 138
michael@0 139 ARCHIVE_INTERFACE_SUB(IArchiveUpdateCallback, IProgress, 0x80)
michael@0 140 {
michael@0 141 STDMETHOD(GetUpdateItemInfo)(UInt32 index,
michael@0 142 Int32 *newData, // 1 - new data, 0 - old data
michael@0 143 Int32 *newProperties, // 1 - new properties, 0 - old properties
michael@0 144 UInt32 *indexInArchive // -1 if there is no in archive, or if doesn't matter
michael@0 145 ) PURE;
michael@0 146 STDMETHOD(GetProperty)(UInt32 index, PROPID propID, PROPVARIANT *value) PURE;
michael@0 147 STDMETHOD(GetStream)(UInt32 index, ISequentialInStream **inStream) PURE;
michael@0 148 STDMETHOD(SetOperationResult)(Int32 operationResult) PURE;
michael@0 149 };
michael@0 150
michael@0 151
michael@0 152 ARCHIVE_INTERFACE_SUB(IArchiveUpdateCallback2, IArchiveUpdateCallback, 0x82)
michael@0 153 {
michael@0 154 STDMETHOD(GetVolumeSize)(UInt32 index, UInt64 *size) PURE;
michael@0 155 STDMETHOD(GetVolumeStream)(UInt32 index, ISequentialOutStream **volumeStream) PURE;
michael@0 156 };
michael@0 157
michael@0 158
michael@0 159 ARCHIVE_INTERFACE(IOutArchive, 0xA0)
michael@0 160 {
michael@0 161 STDMETHOD(UpdateItems)(ISequentialOutStream *outStream, UInt32 numItems,
michael@0 162 IArchiveUpdateCallback *updateCallback) PURE;
michael@0 163 STDMETHOD(GetFileTimeType)(UInt32 *type) PURE;
michael@0 164 };
michael@0 165
michael@0 166
michael@0 167 ARCHIVE_INTERFACE(ISetProperties, 0x03)
michael@0 168 {
michael@0 169 STDMETHOD(SetProperties)(const wchar_t **names, const PROPVARIANT *values, Int32 numProperties) PURE;
michael@0 170 };
michael@0 171
michael@0 172
michael@0 173 #endif

mercurial