view src/win32/7zip/7z/CPP/7zip/Archive/Rar/RarItem.cpp @ 1:f9f4f1b99eed

importing src directory
author Robert McIntyre <rlm@mit.edu>
date Sat, 03 Mar 2012 10:31:27 -0600
parents
children
line wrap: on
line source
1 // RarItem.cpp
3 #include "StdAfx.h"
5 #include "RarItem.h"
7 namespace NArchive{
8 namespace NRar{
10 bool CItem::IgnoreItem() const
11 {
12 switch(HostOS)
13 {
14 case NHeader::NFile::kHostMSDOS:
15 case NHeader::NFile::kHostOS2:
16 case NHeader::NFile::kHostWin32:
17 return ((Attrib & NHeader::NFile::kLabelFileAttribute) != 0);
18 }
19 return false;
20 }
22 bool CItem::IsDir() const
23 {
24 if (GetDictSize() == NHeader::NFile::kDictDirectoryValue)
25 return true;
26 switch(HostOS)
27 {
28 case NHeader::NFile::kHostMSDOS:
29 case NHeader::NFile::kHostOS2:
30 case NHeader::NFile::kHostWin32:
31 if ((Attrib & FILE_ATTRIBUTE_DIRECTORY) != 0)
32 return true;
33 }
34 return false;
35 }
37 UInt32 CItem::GetWinAttributes() const
38 {
39 UInt32 winAttributes;
40 switch(HostOS)
41 {
42 case NHeader::NFile::kHostMSDOS:
43 case NHeader::NFile::kHostOS2:
44 case NHeader::NFile::kHostWin32:
45 winAttributes = Attrib;
46 break;
47 default:
48 winAttributes = 0; // must be converted from unix value;
49 }
50 if (IsDir())
51 winAttributes |= NHeader::NFile::kWinFileDirectoryAttributeMask;
52 return winAttributes;
53 }
55 }}