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

« back to all changes in this revision

Viewing changes to CPP/7zip/Archive/Zip/ZipItem.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:
32
32
 
33
33
struct CWzAesExtraField
34
34
{
35
 
  UInt16 VendorVersion; // 0x0001 - AE-1, 0x0002 - AE-2, 
36
 
  // UInt16 VendorId; // "AE" 
 
35
  UInt16 VendorVersion; // 0x0001 - AE-1, 0x0002 - AE-2,
 
36
  // UInt16 VendorId; // "AE"
37
37
  Byte Strength; // 1 - 128-bit , 2 - 192-bit , 3 - 256-bit
38
38
  UInt16 Method;
39
39
 
111
111
{
112
112
  CObjectVector<CExtraSubBlock> SubBlocks;
113
113
  void Clear() { SubBlocks.Clear(); }
114
 
  size_t GetSize() const 
 
114
  size_t GetSize() const
115
115
  {
116
116
    size_t res = 0;
117
117
    for (int i = 0; i < SubBlocks.Size(); i++)
118
118
      res += SubBlocks[i].Data.GetCapacity() + 2 + 2;
119
119
    return res;
120
120
  }
121
 
  bool GetWzAesField(CWzAesExtraField &aesField) const 
 
121
  bool GetWzAesField(CWzAesExtraField &aesField) const
122
122
  {
123
123
    for (int i = 0; i < SubBlocks.Size(); i++)
124
124
      if (aesField.ParseFromSubBlock(SubBlocks[i]))
126
126
    return false;
127
127
  }
128
128
 
129
 
  bool GetStrongCryptoField(CStrongCryptoField &f) const 
 
129
  bool GetStrongCryptoField(CStrongCryptoField &f) const
130
130
  {
131
131
    for (int i = 0; i < SubBlocks.Size(); i++)
132
132
      if (f.ParseFromSubBlock(SubBlocks[i]))
134
134
    return false;
135
135
  }
136
136
 
137
 
  bool HasWzAesField() const 
 
137
  bool HasWzAesField() const
138
138
  {
139
139
    CWzAesExtraField aesField;
140
140
    return GetWzAesField(aesField);
141
141
  }
142
142
 
143
 
  bool GetNtfsTime(int index, FILETIME &ft) const 
 
143
  bool GetNtfsTime(int index, FILETIME &ft) const
144
144
  {
145
145
    for (int i = 0; i < SubBlocks.Size(); i++)
146
146
    {
152
152
  }
153
153
 
154
154
  /*
155
 
  bool HasStrongCryptoField() const 
 
155
  bool HasStrongCryptoField() const
156
156
  {
157
157
    CStrongCryptoField f;
158
158
    return GetStrongCryptoField(f);
187
187
  
188
188
  bool IsEncrypted() const { return (Flags & NFileHeader::NFlags::kEncrypted) != 0; }
189
189
  bool IsStrongEncrypted() const { return IsEncrypted() && (Flags & NFileHeader::NFlags::kStrongEncrypted) != 0; };
190
 
  
191
 
  bool IsImplodeBigDictionary() const;
192
 
  bool IsImplodeLiteralsOn() const;
193
 
  
194
 
  bool IsDirectory() const;
 
190
  bool IsAesEncrypted() const { return IsEncrypted() && (IsStrongEncrypted() || CompressionMethod == NFileHeader::NCompressionMethod::kWzAES); };
 
191
  
 
192
  bool IsLzmaEOS() const { return (Flags & NFileHeader::NFlags::kLzmaEOS) != 0; }
 
193
  
 
194
  bool IsDir() const;
195
195
  bool IgnoreItem() const { return false; }
196
196
  UInt32 GetWinAttributes() const;
197
197
  
198
198
  bool HasDescriptor() const  { return (Flags & NFileHeader::NFlags::kDescriptorUsedMask) != 0; }
199
199
 
200
 
  UString GetUnicodeString(const AString &s) const 
201
 
  { 
 
200
  UString GetUnicodeString(const AString &s) const
 
201
  {
202
202
    UString res;
203
203
    if (IsUtf8())
204
204
      if (!ConvertUTF8ToUnicode(s, res))
239
239
  bool FromCentral;
240
240
  bool NtfsTimeIsDefined;
241
241
  
242
 
  bool IsDirectory() const;
 
242
  bool IsDir() const;
243
243
  UInt32 GetWinAttributes() const;
244
244
 
245
 
  bool IsThereCrc() const 
 
245
  bool IsThereCrc() const
246
246
  {
247
247
    if (CompressionMethod == NFileHeader::NCompressionMethod::kWzAES)
248
248
    {
250
250
      if (CentralExtra.GetWzAesField(aesField))
251
251
        return aesField.NeedCrc();
252
252
    }
253
 
    return (FileCRC != 0 || !IsDirectory());
 
253
    return (FileCRC != 0 || !IsDir());
254
254
  }
255
255
  
256
256
  WORD GetCodePage() const
257
257
  {
258
 
    return (WORD)((MadeByVersion.HostOS == NFileHeader::NHostOS::kFAT 
 
258
    return (WORD)((MadeByVersion.HostOS == NFileHeader::NHostOS::kFAT
259
259
        || MadeByVersion.HostOS == NFileHeader::NHostOS::kNTFS
260
260
        ) ? CP_OEMCP : CP_ACP);
261
261
  }