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

« back to all changes in this revision

Viewing changes to CPP/7zip/Archive/Iso/IsoHandler.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
 
// Iso/Handler.cpp
 
1
// IsoHandler.cpp
2
2
 
3
3
#include "StdAfx.h"
4
4
 
5
 
#include "IsoHandler.h"
6
 
 
 
5
#include "Common/ComTry.h"
7
6
#include "Common/Defs.h"
8
 
#include "Common/StringConvert.h"
9
7
#include "Common/IntToString.h"
10
8
#include "Common/NewHandler.h"
11
 
#include "Common/ComTry.h"
 
9
#include "Common/StringConvert.h"
12
10
 
 
11
#include "Windows/PropVariant.h"
13
12
#include "Windows/Time.h"
14
 
#include "Windows/PropVariant.h"
15
13
 
 
14
#include "../../Common/LimitedStreams.h"
16
15
#include "../../Common/ProgressUtils.h"
17
 
#include "../../Common/LimitedStreams.h"
18
16
 
19
 
#include "../../Compress/Copy/CopyCoder.h"
 
17
#include "../../Compress/CopyCoder.h"
20
18
 
21
19
#include "../Common/ItemNameUtils.h"
22
20
 
 
21
#include "IsoHandler.h"
 
22
 
23
23
using namespace NWindows;
24
24
using namespace NTime;
25
25
 
26
26
namespace NArchive {
27
27
namespace NIso {
28
28
 
29
 
STATPROPSTG kProps[] = 
 
29
STATPROPSTG kProps[] =
30
30
{
31
31
  { NULL, kpidPath, VT_BSTR},
32
 
  { NULL, kpidIsFolder, VT_BOOL},
 
32
  { NULL, kpidIsDir, VT_BOOL},
33
33
  { NULL, kpidSize, VT_UI8},
34
 
  { NULL, kpidPackedSize, VT_UI8},
35
 
  { NULL, kpidLastWriteTime, VT_FILETIME}
 
34
  { NULL, kpidPackSize, VT_UI8},
 
35
  { NULL, kpidMTime, VT_FILETIME}
36
36
};
37
37
 
38
38
IMP_IInArchive_Props
39
39
IMP_IInArchive_ArcProps_NO
40
40
 
41
 
STDMETHODIMP CHandler::Open(IInStream *stream, 
 
41
STDMETHODIMP CHandler::Open(IInStream *stream,
42
42
    const UInt64 * /* maxCheckStartPosition */,
43
43
    IArchiveOpenCallback * /* openArchiveCallback */)
44
44
{
89
89
        prop = (const wchar_t *)s;
90
90
        break;
91
91
      }
92
 
      case kpidIsFolder:
 
92
      case kpidIsDir:
93
93
        prop = false;
94
94
        break;
95
95
      case kpidSize:
96
 
      case kpidPackedSize:
97
 
      {
 
96
      case kpidPackSize:
98
97
        prop = (UInt64)_archive.GetBootItemSize(index);
99
98
        break;
100
 
      }
101
99
    }
102
100
  }
103
101
  else
125
123
          prop = (const wchar_t *)NItemName::GetOSName2(s);
126
124
        }
127
125
        break;
128
 
      case kpidIsFolder:
 
126
      case kpidIsDir:
129
127
        prop = item.IsDir();
130
128
        break;
131
129
      case kpidSize:
132
 
      case kpidPackedSize:
 
130
      case kpidPackSize:
133
131
        if (!item.IsDir())
134
132
          prop = (UInt64)item.DataLength;
135
133
        break;
136
 
      case kpidLastWriteTime:
 
134
      case kpidMTime:
137
135
      {
138
136
        FILETIME utcFileTime;
139
137
        if (item.DateTime.GetFileTime(utcFileTime))
242
240
    streamSpec->Init(currentItemSize);
243
241
    RINOK(copyCoder->Code(inStream, realOutStream, NULL, NULL, progress));
244
242
    realOutStream.Release();
245
 
    RINOK(extractCallback->SetOperationResult((copyCoderSpec->TotalSize == currentItemSize) ? 
 
243
    RINOK(extractCallback->SetOperationResult((copyCoderSpec->TotalSize == currentItemSize) ?
246
244
        NArchive::NExtract::NOperationResult::kOK:
247
245
        NArchive::NExtract::NOperationResult::kDataError));
248
246
  }