diff src/win32/7zip/7z/CPP/7zip/Archive/GZip/GZipItem.h @ 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 diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/src/win32/7zip/7z/CPP/7zip/Archive/GZip/GZipItem.h	Sat Mar 03 10:31:27 2012 -0600
     1.3 @@ -0,0 +1,59 @@
     1.4 +// Archive/GZipItem.h
     1.5 +
     1.6 +#ifndef __ARCHIVE_GZIP_ITEM_H
     1.7 +#define __ARCHIVE_GZIP_ITEM_H
     1.8 +
     1.9 +#include "Common/Types.h"
    1.10 +#include "Common/MyString.h"
    1.11 +#include "Common/Buffer.h"
    1.12 +
    1.13 +namespace NArchive {
    1.14 +namespace NGZip {
    1.15 +
    1.16 +class CItem
    1.17 +{
    1.18 +private:
    1.19 +  bool TestFlag(Byte flag) const { return ((Flags & flag) != 0); }
    1.20 +public:
    1.21 +  Byte CompressionMethod;
    1.22 +  Byte Flags;
    1.23 +  UInt32 Time;
    1.24 +  Byte ExtraFlags;
    1.25 +  Byte HostOS;
    1.26 +  UInt32 FileCRC;
    1.27 +  UInt32 UnPackSize32;
    1.28 +
    1.29 +  AString Name;
    1.30 +  AString Comment;
    1.31 +  CByteBuffer Extra;
    1.32 +
    1.33 +  bool IsText() const
    1.34 +    {  return TestFlag(NFileHeader::NFlags::kDataIsText); }
    1.35 +  bool HeaderCRCIsPresent() const
    1.36 +    {  return TestFlag(NFileHeader::NFlags::kHeaderCRCIsPresent); }
    1.37 +  bool ExtraFieldIsPresent() const
    1.38 +    {  return TestFlag(NFileHeader::NFlags::kExtraIsPresent); }
    1.39 +  bool NameIsPresent() const
    1.40 +    {  return TestFlag(NFileHeader::NFlags::kNameIsPresent); }
    1.41 +  bool CommentIsPresent() const
    1.42 +    {  return TestFlag(NFileHeader::NFlags::kComentIsPresent); }
    1.43 +
    1.44 +  void SetNameIsPresentFlag(bool nameIsPresent)
    1.45 +  {
    1.46 +    if (nameIsPresent)
    1.47 +      Flags |= NFileHeader::NFlags::kNameIsPresent;
    1.48 +    else
    1.49 +      Flags &= (~NFileHeader::NFlags::kNameIsPresent);
    1.50 +  }
    1.51 +
    1.52 +  void Clear()
    1.53 +  {
    1.54 +    Name.Empty();
    1.55 +    Comment.Empty();;
    1.56 +    Extra.SetCapacity(0);
    1.57 +  }
    1.58 +};
    1.59 +
    1.60 +}}
    1.61 +
    1.62 +#endif