mirror of
https://github.com/Xevion/easy7zip.git
synced 2025-12-14 08:11:35 -06:00
3.13
This commit is contained in:
67
7zip/Archive/Tar/TarItem.h
Executable file
67
7zip/Archive/Tar/TarItem.h
Executable file
@@ -0,0 +1,67 @@
|
||||
// Archive/Tar/Item.h
|
||||
|
||||
#pragma once
|
||||
|
||||
#ifndef __ARCHIVE_TAR_ITEM_H
|
||||
#define __ARCHIVE_TAR_ITEM_H
|
||||
|
||||
#include <time.h>
|
||||
|
||||
#include "Common/Types.h"
|
||||
#include "Common/String.h"
|
||||
#include "TarHeader.h"
|
||||
|
||||
namespace NArchive {
|
||||
namespace NTar {
|
||||
|
||||
class CItem
|
||||
{
|
||||
public:
|
||||
AString Name;
|
||||
UINT32 Mode;
|
||||
UINT32 UID;
|
||||
UINT32 GID;
|
||||
UINT64 Size;
|
||||
time_t ModificationTime;
|
||||
char LinkFlag;
|
||||
AString LinkName;
|
||||
char Magic[8];
|
||||
AString UserName;
|
||||
AString GroupName;
|
||||
|
||||
bool DeviceMajorDefined;
|
||||
UINT32 DeviceMajor;
|
||||
bool DeviceMinorDefined;
|
||||
UINT32 DeviceMinor;
|
||||
|
||||
bool IsDirectory() const
|
||||
{
|
||||
if (LinkFlag == NFileHeader::NLinkFlag::kDirectory)
|
||||
return true;
|
||||
if (LinkFlag == NFileHeader::NLinkFlag::kOldNormal ||
|
||||
LinkFlag == NFileHeader::NLinkFlag::kNormal)
|
||||
{
|
||||
if (Name.IsEmpty())
|
||||
return false;
|
||||
#ifdef WIN32
|
||||
return (*CharPrevExA(CP_OEMCP, Name, &Name[Name.Length()], 0) == '/');
|
||||
#else
|
||||
return (Name[Name.Length() - 1) == '/');
|
||||
#endif
|
||||
}
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
||||
class CItemEx: public CItem
|
||||
{
|
||||
public:
|
||||
UINT64 HeaderPosition;
|
||||
UINT64 LongLinkSize;
|
||||
UINT64 GetDataPosition() const { return HeaderPosition + LongLinkSize + NFileHeader::kRecordSize; };
|
||||
UINT64 GetFullSize() const { return LongLinkSize + NFileHeader::kRecordSize + Size; };
|
||||
};
|
||||
|
||||
}}
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user