Mercurial > vba-linux
comparison src/win32/7zip/7z/CPP/7zip/Archive/Rar/RarItem.h @ 1:f9f4f1b99eed
importing src directory
author | Robert McIntyre <rlm@mit.edu> |
---|---|
date | Sat, 03 Mar 2012 10:31:27 -0600 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
0:8ced16adf2e1 | 1:f9f4f1b99eed |
---|---|
1 // RarItem.h | |
2 | |
3 #ifndef __ARCHIVE_RAR_ITEM_H | |
4 #define __ARCHIVE_RAR_ITEM_H | |
5 | |
6 #include "Common/Types.h" | |
7 #include "Common/MyString.h" | |
8 | |
9 #include "RarHeader.h" | |
10 | |
11 namespace NArchive{ | |
12 namespace NRar{ | |
13 | |
14 struct CRarTime | |
15 { | |
16 UInt32 DosTime; | |
17 Byte LowSecond; | |
18 Byte SubTime[3]; | |
19 }; | |
20 | |
21 struct CItem | |
22 { | |
23 UInt64 Size; | |
24 UInt64 PackSize; | |
25 | |
26 CRarTime CTime; | |
27 CRarTime ATime; | |
28 CRarTime MTime; | |
29 | |
30 UInt32 FileCRC; | |
31 UInt32 Attrib; | |
32 | |
33 UInt16 Flags; | |
34 Byte HostOS; | |
35 Byte UnPackVersion; | |
36 Byte Method; | |
37 | |
38 bool CTimeDefined; | |
39 bool ATimeDefined; | |
40 | |
41 AString Name; | |
42 UString UnicodeName; | |
43 | |
44 Byte Salt[8]; | |
45 | |
46 bool IsEncrypted() const { return (Flags & NHeader::NFile::kEncrypted) != 0; } | |
47 bool IsSolid() const { return (Flags & NHeader::NFile::kSolid) != 0; } | |
48 bool IsCommented() const { return (Flags & NHeader::NFile::kComment) != 0; } | |
49 bool IsSplitBefore() const { return (Flags & NHeader::NFile::kSplitBefore) != 0; } | |
50 bool IsSplitAfter() const { return (Flags & NHeader::NFile::kSplitAfter) != 0; } | |
51 bool HasSalt() const { return (Flags & NHeader::NFile::kSalt) != 0; } | |
52 bool HasExtTime() const { return (Flags & NHeader::NFile::kExtTime) != 0; } | |
53 bool HasUnicodeName()const { return (Flags & NHeader::NFile::kUnicodeName) != 0; } | |
54 bool IsOldVersion() const { return (Flags & NHeader::NFile::kOldVersion) != 0; } | |
55 | |
56 UInt32 GetDictSize() const { return (Flags >> NHeader::NFile::kDictBitStart) & NHeader::NFile::kDictMask; } | |
57 bool IsDir() const; | |
58 bool IgnoreItem() const; | |
59 UInt32 GetWinAttributes() const; | |
60 | |
61 CItem(): CTimeDefined(false), ATimeDefined(false) {} | |
62 }; | |
63 | |
64 class CItemEx: public CItem | |
65 { | |
66 public: | |
67 UInt64 Position; | |
68 UInt16 MainPartSize; | |
69 UInt16 CommentSize; | |
70 UInt16 AlignSize; | |
71 UInt64 GetFullSize() const { return MainPartSize + CommentSize + AlignSize + PackSize; }; | |
72 // DWORD GetHeaderWithCommentSize() const { return MainPartSize + CommentSize; }; | |
73 UInt64 GetCommentPosition() const { return Position + MainPartSize; }; | |
74 UInt64 GetDataPosition() const { return GetCommentPosition() + CommentSize + AlignSize; }; | |
75 }; | |
76 | |
77 }} | |
78 | |
79 #endif |