blob: 7006dfb3a741c79f023e2a93bb78a64c5bf70ebf (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
|
// Archive/GZipItem.h
#ifndef __ARCHIVE_GZIP_ITEM_H
#define __ARCHIVE_GZIP_ITEM_H
#include "Common/Types.h"
#include "Common/String.h"
#include "Common/Buffer.h"
namespace NArchive {
namespace NGZip {
class CItem
{
private:
bool TestFlag(Byte flag) const { return ((Flags & flag) != 0); }
public:
Byte CompressionMethod;
Byte Flags;
UInt32 Time;
Byte ExtraFlags;
Byte HostOS;
UInt32 FileCRC;
UInt32 UnPackSize32;
AString Name;
AString Comment;
CByteBuffer Extra;
bool IsText() const
{ return TestFlag(NFileHeader::NFlags::kDataIsText); }
bool HeaderCRCIsPresent() const
{ return TestFlag(NFileHeader::NFlags::kHeaderCRCIsPresent); }
bool ExtraFieldIsPresent() const
{ return TestFlag(NFileHeader::NFlags::kExtraIsPresent); }
bool NameIsPresent() const
{ return TestFlag(NFileHeader::NFlags::kNameIsPresent); }
bool CommentIsPresent() const
{ return TestFlag(NFileHeader::NFlags::kComentIsPresent); }
void SetNameIsPresentFlag(bool nameIsPresent)
{
if (nameIsPresent)
Flags |= NFileHeader::NFlags::kNameIsPresent;
else
Flags &= (~NFileHeader::NFlags::kNameIsPresent);
}
void Clear()
{
Name.Empty();
Comment.Empty();;
Extra.SetCapacity(0);
}
};
}}
#endif
|