mirror of
https://github.com/claunia/SabreTools.git
synced 2025-12-16 19:14:27 +00:00
[ArchiveTools] Add some preliminary RAR stuff
This commit is contained in:
@@ -80,6 +80,88 @@
|
||||
TorrentLrzip = 7,
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// RAR extra area flag
|
||||
/// </summary>
|
||||
public enum RarExtraAreaFlag : uint
|
||||
{
|
||||
FileEncryption = 0x01,
|
||||
FileHash = 0x02,
|
||||
FileTime = 0x03,
|
||||
FileVersion = 0x04,
|
||||
Redirection = 0x05,
|
||||
UnixOwner = 0x06,
|
||||
ServiceData = 0x07,
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// RAR header types
|
||||
/// </summary>
|
||||
public enum RarHeaderType : uint
|
||||
{
|
||||
MainArchiveHeader = 1,
|
||||
File = 2,
|
||||
Service = 3,
|
||||
ArchiveEncryption = 4,
|
||||
EndOfArchive = 5,
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// RAR entry redirection type
|
||||
/// </summary>
|
||||
public enum RarRedirectionType : uint
|
||||
{
|
||||
UnixSymlink = 0x0001,
|
||||
WindowsSymlink = 0x0002,
|
||||
WindowsJunction = 0x0003,
|
||||
HardLink = 0x0004,
|
||||
FileCopy = 0x0005,
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 7zip Properties
|
||||
/// </summary>
|
||||
public enum SevenZipProperties : uint
|
||||
{
|
||||
kEnd = 0x00,
|
||||
|
||||
kHeader = 0x01,
|
||||
|
||||
kArchiveProperties = 0x02,
|
||||
|
||||
kAdditionalStreamsInfo = 0x03,
|
||||
kMainStreamsInfo = 0x04,
|
||||
kFilesInfo = 0x05,
|
||||
|
||||
kPackInfo = 0x06,
|
||||
kUnPackInfo = 0x07,
|
||||
kSubStreamsInfo = 0x08,
|
||||
|
||||
kSize = 0x09,
|
||||
kCRC = 0x0A,
|
||||
|
||||
kFolder = 0x0B,
|
||||
|
||||
kCodersUnPackSize = 0x0C,
|
||||
kNumUnPackStream = 0x0D,
|
||||
|
||||
kEmptyStream = 0x0E,
|
||||
kEmptyFile = 0x0F,
|
||||
kAnti = 0x10,
|
||||
|
||||
kName = 0x11,
|
||||
kCTime = 0x12,
|
||||
kATime = 0x13,
|
||||
kMTime = 0x14,
|
||||
kWinAttributes = 0x15,
|
||||
kComment = 0x16,
|
||||
|
||||
kEncodedHeader = 0x17,
|
||||
|
||||
kStartPos = 0x18,
|
||||
kDummy = 0x19,
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Zip open type
|
||||
/// </summary>
|
||||
|
||||
@@ -86,6 +86,90 @@ namespace SabreTools.Helper.Data
|
||||
Bit2 = 0x0004,
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// RAR archive flags
|
||||
/// </summary>
|
||||
[Flags]
|
||||
public enum RarArchiveFlags : uint
|
||||
{
|
||||
Volume = 0x0001, // Volume. Archive is a part of multivolume set.
|
||||
VolumeNumberField = 0x0002, // Volume number field is present. This flag is present in all volumes except first.
|
||||
Solid = 0x0004, // Solid archive.
|
||||
RecoveryRecordPresent = 0x0008, // Recovery record is present.
|
||||
Locked = 0x0010, // Locked archive.
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// RAR entry encryption flags
|
||||
/// </summary>
|
||||
[Flags]
|
||||
public enum RarEncryptionFlags : uint
|
||||
{
|
||||
PasswordCheckDataPresent = 0x0001,
|
||||
UseTweakedChecksums = 0x0002,
|
||||
|
||||
/*
|
||||
If flag 0x0002 is present, RAR transforms the checksum preserving file or service data integrity, so it becomes dependent on
|
||||
encryption key. It makes guessing file contents based on checksum impossible. It affects both data CRC32 in file header and
|
||||
checksums in file hash record in extra area.
|
||||
*/
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// RAR file flags
|
||||
/// </summary>
|
||||
[Flags]
|
||||
public enum RarFileFlags : uint
|
||||
{
|
||||
Directory = 0x0001, // Directory file system object (file header only)
|
||||
TimeInUnix = 0x0002, // Time field in Unix format is present
|
||||
CRCPresent = 0x0004, // CRC32 field is present
|
||||
UnpackedSizeUnknown = 0x0008, // Unpacked size is unknown
|
||||
|
||||
/*
|
||||
If flag 0x0008 is set, unpacked size field is still present, but must be ignored and extraction
|
||||
must be performed until reaching the end of compression stream. This flag can be set if actual
|
||||
file size is larger than reported by OS or if file size is unknown such as for all volumes except
|
||||
last when archiving from stdin to multivolume archive
|
||||
*/
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// RAR header flags
|
||||
/// </summary>
|
||||
[Flags]
|
||||
public enum RarHeaderFlags : uint
|
||||
{
|
||||
ExtraAreaPresent = 0x0001, // Extra area is present in the end of header
|
||||
DataAreaPresent = 0x0002, // Data area is present in the end of header
|
||||
BlocksWithUnknownType = 0x0004, // Blocks with unknown type and this flag must be skipped when updating an archive
|
||||
DataAreaContinuingFromPrevious = 0x0008, // Data area is continuing from previous volume
|
||||
DataAreaContinuingToNext = 0x0010, // Data area is continuing in next volume
|
||||
BlockDependsOnPreceding = 0x0020, // Block depends on preceding file block
|
||||
PreserveChildBlock = 0x0040, // Preserve a child block if host block is modified
|
||||
}
|
||||
|
||||
[Flags]
|
||||
public enum RarUnixOwnerRecordFlags : uint
|
||||
{
|
||||
UserNameStringIsPresent = 0x0001,
|
||||
GroupNameStringIsPresent = 0x0002,
|
||||
NumericUserIdIsPresent = 0x0004,
|
||||
NumericGroupIdIsPresent = 0x0008,
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// RAR entry time flags
|
||||
/// </summary>
|
||||
[Flags]
|
||||
public enum RarTimeFlags : uint
|
||||
{
|
||||
TimeInUnixFormat = 0x0001,
|
||||
ModificationTimePresent = 0x0002,
|
||||
CreationTimePresent = 0x0004,
|
||||
LastAccessTimePresent = 0x0008,
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Zipfile special status
|
||||
/// </summary>
|
||||
|
||||
Reference in New Issue
Block a user