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

« back to all changes in this revision

Viewing changes to CPP/7zip/Archive/Split/SplitHandler.cpp

  • 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:
1
 
// Tar/Handler.cpp
 
1
// SplitHandler.cpp
2
2
 
3
3
#include "StdAfx.h"
4
4
 
5
 
#include "SplitHandler.h"
6
 
 
 
5
#include "Common/ComTry.h"
7
6
#include "Common/Defs.h"
 
7
#include "Common/NewHandler.h"
8
8
#include "Common/StringConvert.h"
9
 
#include "Common/NewHandler.h"
10
 
#include "Common/ComTry.h"
11
9
 
 
10
#include "Windows/PropVariant.h"
12
11
#include "Windows/Time.h"
13
 
#include "Windows/PropVariant.h"
14
12
 
15
13
#include "../../Common/ProgressUtils.h"
16
 
#include "../../Compress/Copy/CopyCoder.h"
 
14
 
 
15
#include "../../Compress/CopyCoder.h"
 
16
 
17
17
#include "../Common/ItemNameUtils.h"
18
18
#include "../Common/MultiStream.h"
19
19
 
 
20
#include "SplitHandler.h"
 
21
 
20
22
using namespace NWindows;
21
23
using namespace NTime;
22
24
 
23
25
namespace NArchive {
24
26
namespace NSplit {
25
27
 
26
 
STATPROPSTG kProps[] = 
 
28
STATPROPSTG kProps[] =
27
29
{
28
30
  { NULL, kpidPath, VT_BSTR},
29
 
//  { NULL, kpidIsFolder, VT_BOOL},
30
31
  { NULL, kpidSize, VT_UI8},
31
 
  { NULL, kpidPackedSize, VT_UI8},
 
32
  { NULL, kpidPackSize, VT_UI8},
32
33
};
33
34
 
34
35
IMP_IInArchive_Props
38
39
{
39
40
public:
40
41
  UString _unchangedPart;
41
 
  UString _changedPart;    
 
42
  UString _changedPart;
42
43
  bool _splitStyle;
43
44
  UString GetNextName()
44
45
  {
45
 
    UString newName; 
 
46
    UString newName;
46
47
    if (_splitStyle)
47
48
    {
48
49
      int i;
108
109
  }
109
110
};
110
111
 
111
 
STDMETHODIMP CHandler::Open(IInStream *stream, 
 
112
STDMETHODIMP CHandler::Open(IInStream *stream,
112
113
    const UInt64 * /* maxCheckStartPosition */,
113
114
    IArchiveOpenCallback *openArchiveCallback)
114
115
{
120
121
  {
121
122
    CMyComPtr<IArchiveOpenVolumeCallback> openVolumeCallback;
122
123
    CMyComPtr<IArchiveOpenCallback> openArchiveCallbackWrap = openArchiveCallback;
123
 
    if (openArchiveCallbackWrap.QueryInterface(IID_IArchiveOpenVolumeCallback, 
 
124
    if (openArchiveCallbackWrap.QueryInterface(IID_IArchiveOpenVolumeCallback,
124
125
        &openVolumeCallback) != S_OK)
125
126
      return S_FALSE;
126
127
    
169
170
      if (numLetters != ext.Length())
170
171
        return S_FALSE;
171
172
    }
172
 
    else 
 
173
    else
173
174
      return S_FALSE;
174
175
 
175
176
    _streams.Add(stream);
197
198
    
198
199
    if (openArchiveCallback != NULL)
199
200
    {
200
 
      RINOK(openArchiveCallback->SetTotal(NULL, NULL));
201
201
      UInt64 numFiles = _streams.Size();
202
202
      RINOK(openArchiveCallback->SetCompleted(&numFiles, NULL));
203
203
    }
261
261
    case kpidPath:
262
262
      prop = _subName;
263
263
      break;
264
 
    case kpidIsFolder:
265
 
      prop = false;
266
 
      break;
267
264
    case kpidSize:
268
 
    case kpidPackedSize:
 
265
    case kpidPackSize:
269
266
      prop = _totalSize;
270
267
      break;
271
268
  }