mirror of
https://github.com/Xevion/easy7zip.git
synced 2025-12-08 12:07:03 -06:00
60 lines
1.2 KiB
C++
Executable File
60 lines
1.2 KiB
C++
Executable File
// 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
|