Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/kornelski/7z.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'CPP/7zip/Archive/Tar/TarItem.h')
-rwxr-xr-xCPP/7zip/Archive/Tar/TarItem.h17
1 files changed, 14 insertions, 3 deletions
diff --git a/CPP/7zip/Archive/Tar/TarItem.h b/CPP/7zip/Archive/Tar/TarItem.h
index 859e66dd..3584a7ce 100755
--- a/CPP/7zip/Archive/Tar/TarItem.h
+++ b/CPP/7zip/Archive/Tar/TarItem.h
@@ -10,15 +10,22 @@
namespace NArchive {
namespace NTar {
+struct CSparseBlock
+{
+ UInt64 Offset;
+ UInt64 Size;
+};
+
struct CItem
{
AString Name;
+ UInt64 PackSize;
UInt64 Size;
+ Int64 MTime;
UInt32 Mode;
UInt32 UID;
UInt32 GID;
- UInt32 MTime;
UInt32 DeviceMajor;
UInt32 DeviceMinor;
@@ -31,7 +38,10 @@ struct CItem
bool DeviceMajorDefined;
bool DeviceMinorDefined;
+ CRecordVector<CSparseBlock> SparseBlocks;
+
bool IsLink() const { return LinkFlag == NFileHeader::NLinkFlag::kSymbolicLink && (Size == 0); }
+ bool IsSparse() const { return LinkFlag == NFileHeader::NLinkFlag::kSparse; }
UInt64 GetUnpackSize() const { return IsLink() ? LinkName.Length() : Size; }
bool IsDir() const
@@ -56,15 +66,16 @@ struct CItem
return true;
}
- UInt64 GetPackSize() const { return (Size + 0x1FF) & (~((UInt64)0x1FF)); }
+ UInt64 GetPackSizeAligned() const { return (PackSize + 0x1FF) & (~((UInt64)0x1FF)); }
};
struct CItemEx: public CItem
{
UInt64 HeaderPos;
unsigned HeaderSize;
+
UInt64 GetDataPosition() const { return HeaderPos + HeaderSize; }
- UInt64 GetFullSize() const { return HeaderSize + Size; }
+ UInt64 GetFullSize() const { return HeaderSize + PackSize; }
};
}}