diff 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
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/Rar/RarItem.h	Sat Mar 03 10:31:27 2012 -0600
     1.3 @@ -0,0 +1,79 @@
     1.4 +// RarItem.h
     1.5 +
     1.6 +#ifndef __ARCHIVE_RAR_ITEM_H
     1.7 +#define __ARCHIVE_RAR_ITEM_H
     1.8 +
     1.9 +#include "Common/Types.h"
    1.10 +#include "Common/MyString.h"
    1.11 +
    1.12 +#include "RarHeader.h"
    1.13 +
    1.14 +namespace NArchive{
    1.15 +namespace NRar{
    1.16 +
    1.17 +struct CRarTime
    1.18 +{
    1.19 +  UInt32 DosTime;
    1.20 +  Byte LowSecond;
    1.21 +  Byte SubTime[3];
    1.22 +};
    1.23 +
    1.24 +struct CItem
    1.25 +{
    1.26 +  UInt64 Size;
    1.27 +  UInt64 PackSize;
    1.28 +  
    1.29 +  CRarTime CTime;
    1.30 +  CRarTime ATime;
    1.31 +  CRarTime MTime;
    1.32 +
    1.33 +  UInt32 FileCRC;
    1.34 +  UInt32 Attrib;
    1.35 +
    1.36 +  UInt16 Flags;
    1.37 +  Byte HostOS;
    1.38 +  Byte UnPackVersion;
    1.39 +  Byte Method;
    1.40 +
    1.41 +  bool CTimeDefined;
    1.42 +  bool ATimeDefined;
    1.43 +
    1.44 +  AString Name;
    1.45 +  UString UnicodeName;
    1.46 +
    1.47 +  Byte Salt[8];
    1.48 +  
    1.49 +  bool IsEncrypted()   const { return (Flags & NHeader::NFile::kEncrypted) != 0; }
    1.50 +  bool IsSolid()       const { return (Flags & NHeader::NFile::kSolid) != 0; }
    1.51 +  bool IsCommented()   const { return (Flags & NHeader::NFile::kComment) != 0; }
    1.52 +  bool IsSplitBefore() const { return (Flags & NHeader::NFile::kSplitBefore) != 0; }
    1.53 +  bool IsSplitAfter()  const { return (Flags & NHeader::NFile::kSplitAfter) != 0; }
    1.54 +  bool HasSalt()       const { return (Flags & NHeader::NFile::kSalt) != 0; }
    1.55 +  bool HasExtTime()    const { return (Flags & NHeader::NFile::kExtTime) != 0; }
    1.56 +  bool HasUnicodeName()const { return (Flags & NHeader::NFile::kUnicodeName) != 0; }
    1.57 +  bool IsOldVersion()  const { return (Flags & NHeader::NFile::kOldVersion) != 0; }
    1.58 +  
    1.59 +  UInt32 GetDictSize() const { return (Flags >> NHeader::NFile::kDictBitStart) & NHeader::NFile::kDictMask; }
    1.60 +  bool IsDir() const;
    1.61 +  bool IgnoreItem() const;
    1.62 +  UInt32 GetWinAttributes() const;
    1.63 +  
    1.64 +  CItem(): CTimeDefined(false), ATimeDefined(false) {}
    1.65 +};
    1.66 +
    1.67 +class CItemEx: public CItem
    1.68 +{
    1.69 +public:
    1.70 +  UInt64 Position;
    1.71 +  UInt16 MainPartSize;
    1.72 +  UInt16 CommentSize;
    1.73 +  UInt16 AlignSize;
    1.74 +  UInt64 GetFullSize()  const { return MainPartSize + CommentSize + AlignSize + PackSize; };
    1.75 +  //  DWORD GetHeaderWithCommentSize()  const { return MainPartSize + CommentSize; };
    1.76 +  UInt64 GetCommentPosition() const { return Position + MainPartSize; };
    1.77 +  UInt64 GetDataPosition()    const { return GetCommentPosition() + CommentSize + AlignSize; };
    1.78 +};
    1.79 +
    1.80 +}}
    1.81 +
    1.82 +#endif