~ubuntu-branches/ubuntu/precise/p7zip/precise-updates

« back to all changes in this revision

Viewing changes to CPP/7zip/Archive/IArchive.h

  • Committer: Bazaar Package Importer
  • Author(s): Mohammed Adnène Trojette
  • Date: 2009-02-14 20:12:27 UTC
  • mfrom: (1.1.11 upstream) (2.1.3 sid)
  • Revision ID: james.westby@ubuntu.com-20090214201227-go63qxm9ozfdma60
Tags: 4.65~dfsg.1-1
* New upstream release.
* Remove wx2.8 Build-Depends added by mistakes (7zG is not yet
  intended to be built).
* Use dh_clean without -k.

Show diffs side-by-side

added added

removed removed

Lines of Context:
22
22
 
23
23
namespace NArchive
24
24
{
25
 
  enum 
 
25
  enum
26
26
  {
27
27
    kName = 0,
28
28
    kClassID,
39
39
  {
40
40
    namespace NAskMode
41
41
    {
42
 
      enum 
 
42
      enum
43
43
      {
44
44
        kExtract = 0,
45
45
        kTest,
48
48
    }
49
49
    namespace NOperationResult
50
50
    {
51
 
      enum 
 
51
      enum
52
52
      {
53
53
        kOK = 0,
54
54
        kUnSupportedMethod,
61
61
  {
62
62
    namespace NOperationResult
63
63
    {
64
 
      enum 
 
64
      enum
65
65
      {
66
66
        kOK = 0,
67
67
        kError
70
70
  }
71
71
}
72
72
 
 
73
#define INTERFACE_IArchiveOpenCallback(x) \
 
74
  STDMETHOD(SetTotal)(const UInt64 *files, const UInt64 *bytes) x; \
 
75
  STDMETHOD(SetCompleted)(const UInt64 *files, const UInt64 *bytes) x; \
 
76
 
73
77
ARCHIVE_INTERFACE(IArchiveOpenCallback, 0x10)
74
78
{
75
 
  STDMETHOD(SetTotal)(const UInt64 *files, const UInt64 *bytes) PURE;
76
 
  STDMETHOD(SetCompleted)(const UInt64 *files, const UInt64 *bytes) PURE;
 
79
  INTERFACE_IArchiveOpenCallback(PURE);
77
80
};
78
81
 
79
82
 
 
83
#define INTERFACE_IArchiveExtractCallback(x) \
 
84
  INTERFACE_IProgress(x) \
 
85
  /* GetStream OUT: S_OK - OK, S_FALSE - skeep this file */ \
 
86
  STDMETHOD(GetStream)(UInt32 index, ISequentialOutStream **outStream,  Int32 askExtractMode) x; \
 
87
  STDMETHOD(PrepareOperation)(Int32 askExtractMode) x; \
 
88
  STDMETHOD(SetOperationResult)(Int32 resultEOperationResult) x; \
 
89
 
80
90
ARCHIVE_INTERFACE_SUB(IArchiveExtractCallback, IProgress, 0x20)
81
91
{
82
 
  STDMETHOD(GetStream)(UInt32 index, ISequentialOutStream **outStream, 
83
 
      Int32 askExtractMode) PURE;
84
 
  // GetStream OUT: S_OK - OK, S_FALSE - skeep this file
85
 
  STDMETHOD(PrepareOperation)(Int32 askExtractMode) PURE;
86
 
  STDMETHOD(SetOperationResult)(Int32 resultEOperationResult) PURE;
 
92
  INTERFACE_IArchiveExtractCallback(PURE)
87
93
};
88
94
 
89
95
 
 
96
#define INTERFACE_IArchiveOpenVolumeCallback(x) \
 
97
  STDMETHOD(GetProperty)(PROPID propID, PROPVARIANT *value) x; \
 
98
  STDMETHOD(GetStream)(const wchar_t *name, IInStream **inStream) x; \
 
99
 
90
100
ARCHIVE_INTERFACE(IArchiveOpenVolumeCallback, 0x30)
91
101
{
92
 
  STDMETHOD(GetProperty)(PROPID propID, PROPVARIANT *value) PURE;
93
 
  STDMETHOD(GetStream)(const wchar_t *name, IInStream **inStream) PURE;
 
102
  INTERFACE_IArchiveOpenVolumeCallback(PURE);
94
103
};
95
104
 
96
105
 
97
106
ARCHIVE_INTERFACE(IInArchiveGetStream, 0x40)
98
107
{
99
 
  STDMETHOD(GetStream)(UInt32 index, ISequentialInStream **stream) PURE;  
 
108
  STDMETHOD(GetStream)(UInt32 index, ISequentialInStream **stream) PURE;
100
109
};
101
110
 
102
111
 
108
117
 
109
118
/*
110
119
IInArchive::Extract:
111
 
  indices must be sorted 
 
120
  indices must be sorted
112
121
  numItems = 0xFFFFFFFF means "all files"
113
122
  testMode != 0 means "test files without writing to outStream"
114
123
*/
131
140
};
132
141
 
133
142
 
 
143
#define INTERFACE_IArchiveUpdateCallback(x) \
 
144
  INTERFACE_IProgress(x); \
 
145
  STDMETHOD(GetUpdateItemInfo)(UInt32 index,  \
 
146
      Int32 *newData, /*1 - new data, 0 - old data */ \
 
147
      Int32 *newProperties, /* 1 - new properties, 0 - old properties */ \
 
148
      UInt32 *indexInArchive /* -1 if there is no in archive, or if doesn't matter */ \
 
149
      )  x; \
 
150
  STDMETHOD(GetProperty)(UInt32 index, PROPID propID, PROPVARIANT *value) x; \
 
151
  STDMETHOD(GetStream)(UInt32 index, ISequentialInStream **inStream) x; \
 
152
  STDMETHOD(SetOperationResult)(Int32 operationResult) x; \
 
153
 
134
154
ARCHIVE_INTERFACE_SUB(IArchiveUpdateCallback, IProgress, 0x80)
135
155
{
136
 
  STDMETHOD(GetUpdateItemInfo)(UInt32 index, 
137
 
      Int32 *newData, // 1 - new data, 0 - old data
138
 
      Int32 *newProperties, // 1 - new properties, 0 - old properties
139
 
      UInt32 *indexInArchive // -1 if there is no in archive, or if doesn't matter
140
 
      ) PURE;
141
 
  STDMETHOD(GetProperty)(UInt32 index, PROPID propID, PROPVARIANT *value) PURE;
142
 
  STDMETHOD(GetStream)(UInt32 index, ISequentialInStream **inStream) PURE;
143
 
  STDMETHOD(SetOperationResult)(Int32 operationResult) PURE;
 
156
  INTERFACE_IArchiveUpdateCallback(PURE);
144
157
};
145
158
 
 
159
#define INTERFACE_IArchiveUpdateCallback2(x) \
 
160
  INTERFACE_IArchiveUpdateCallback(x) \
 
161
  STDMETHOD(GetVolumeSize)(UInt32 index, UInt64 *size) x; \
 
162
  STDMETHOD(GetVolumeStream)(UInt32 index, ISequentialOutStream **volumeStream) x; \
146
163
 
147
164
ARCHIVE_INTERFACE_SUB(IArchiveUpdateCallback2, IArchiveUpdateCallback, 0x82)
148
165
{
149
 
  STDMETHOD(GetVolumeSize)(UInt32 index, UInt64 *size) PURE;
150
 
  STDMETHOD(GetVolumeStream)(UInt32 index, ISequentialOutStream **volumeStream) PURE;
 
166
  INTERFACE_IArchiveUpdateCallback2(PURE);
151
167
};
152
168
 
153
169
 
196
212
    { *numProperties = sizeof(kArcProps) / sizeof(kArcProps[0]); return S_OK; } \
197
213
  STDMETHODIMP CHandler::GetArchivePropertyInfo IMP_IInArchive_GetProp(kArcProps)
198
214
 
 
215
#define IMP_IInArchive_ArcProps_WITH_NAME \
 
216
  STDMETHODIMP CHandler::GetNumberOfArchiveProperties(UInt32 *numProperties) \
 
217
    { *numProperties = sizeof(kArcProps) / sizeof(kArcProps[0]); return S_OK; } \
 
218
  STDMETHODIMP CHandler::GetArchivePropertyInfo IMP_IInArchive_GetProp_WITH_NAME(kArcProps)
 
219
 
199
220
#define IMP_IInArchive_ArcProps_NO \
200
221
  STDMETHODIMP CHandler::GetNumberOfArchiveProperties(UInt32 *numProperties) \
201
222
    { *numProperties = 0; return S_OK; } \
202
223
  STDMETHODIMP CHandler::GetArchivePropertyInfo(UInt32, BSTR *, PROPID *, VARTYPE *) \
203
224
    { return E_NOTIMPL; } \
204
225
  STDMETHODIMP CHandler::GetArchiveProperty(PROPID, PROPVARIANT *value) \
205
 
    { value->vt = VT_EMPTY; return S_OK; } 
 
226
    { value->vt = VT_EMPTY; return S_OK; }
206
227
 
207
228
#endif