4.27 beta

This commit is contained in:
Igor Pavlov
2005-09-21 00:00:00 +00:00
committed by Kornel Lesiński
parent 31e7b924e8
commit d66cf2fcf3
393 changed files with 17345 additions and 4743 deletions

View File

@@ -1,7 +1,7 @@
// Archive/Cab/ItemInfo.h
// Archive/CabItem.h
#ifndef __ARCHIVE_RAR_ITEMINFO_H
#define __ARCHIVE_RAR_ITEMINFO_H
#ifndef __ARCHIVE_CAB_ITEM_H
#define __ARCHIVE_CAB_ITEM_H
#include "Common/Types.h"
#include "Common/String.h"
@@ -10,23 +10,53 @@
namespace NArchive {
namespace NCab {
struct CFolder
{
UInt32 DataStart; // offset of the first CFDATA block in this folder
UInt16 NumDataBlocks; // number of CFDATA blocks in this folder
Byte CompressionTypeMajor;
Byte CompressionTypeMinor;
Byte GetCompressionMethod() const { return (Byte)(CompressionTypeMajor & 0xF); }
};
class CItem
{
public:
UInt16 Flags;
UInt64 UnPackSize;
UInt32 UnPackOffset;
UInt16 FolderIndex;
AString Name;
UInt32 Offset;
UInt32 Size;
UInt32 Time;
UInt16 Attributes;
UInt32 GetWinAttributes() const { return Attributes & (Attributes & ~NHeader::kFileNameIsUTFAttributeMask); }
UInt16 FolderIndex;
UInt16 Flags;
UInt16 Attributes;
UInt64 GetEndOffset() const { return (UInt64)Offset + Size; }
UInt32 GetWinAttributes() const { return (Attributes & ~NHeader::kFileNameIsUTFAttributeMask); }
bool IsNameUTF() const { return (Attributes & NHeader::kFileNameIsUTFAttributeMask) != 0; }
bool IsDirectory() const { return (Attributes & FILE_ATTRIBUTE_DIRECTORY) != 0; }
AString Name;
bool ContinuedFromPrev() const
{
return
(FolderIndex == NHeader::NFolderIndex::kContinuedFromPrev) ||
(FolderIndex == NHeader::NFolderIndex::kContinuedPrevAndNext);
}
bool ContinuedToNext() const
{
return
(FolderIndex == NHeader::NFolderIndex::kContinuedToNext) ||
(FolderIndex == NHeader::NFolderIndex::kContinuedPrevAndNext);
}
int GetFolderIndex(int numFolders) const
{
if (ContinuedFromPrev())
return 0;
if (ContinuedToNext())
return (numFolders - 1);
return FolderIndex;
}
};
}}
#endif