diff options
Diffstat (limited to 'CPP/7zip/Archive/Tar/TarItem.h')
-rwxr-xr-x | CPP/7zip/Archive/Tar/TarItem.h | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/CPP/7zip/Archive/Tar/TarItem.h b/CPP/7zip/Archive/Tar/TarItem.h index afe8997d..859e66dd 100755 --- a/CPP/7zip/Archive/Tar/TarItem.h +++ b/CPP/7zip/Archive/Tar/TarItem.h @@ -31,6 +31,9 @@ struct CItem bool DeviceMajorDefined; bool DeviceMinorDefined; + bool IsLink() const { return LinkFlag == NFileHeader::NLinkFlag::kSymbolicLink && (Size == 0); } + UInt64 GetUnpackSize() const { return IsLink() ? LinkName.Length() : Size; } + bool IsDir() const { switch(LinkFlag) @@ -58,10 +61,10 @@ struct CItem struct CItemEx: public CItem { - UInt64 HeaderPosition; - unsigned LongLinkSize; - UInt64 GetDataPosition() const { return HeaderPosition + LongLinkSize + NFileHeader::kRecordSize; } - UInt64 GetFullSize() const { return LongLinkSize + NFileHeader::kRecordSize + Size; } + UInt64 HeaderPos; + unsigned HeaderSize; + UInt64 GetDataPosition() const { return HeaderPos + HeaderSize; } + UInt64 GetFullSize() const { return HeaderSize + Size; } }; }} |