mirror of
https://github.com/aaru-dps/Aaru.git
synced 2025-12-16 19:24:25 +00:00
[Aaru.Filesystems] Reformat and cleanup.
This commit is contained in:
@@ -44,11 +44,11 @@ public sealed partial class ISO9660
|
||||
|
||||
var decodedVd = new DecodedVolumeDescriptor
|
||||
{
|
||||
SystemIdentifier = StringHandlers.CToString(pvd.system_id, encoding).TrimEnd(),
|
||||
VolumeIdentifier = StringHandlers.CToString(pvd.volume_id, encoding).TrimEnd(),
|
||||
VolumeSetIdentifier = StringHandlers.CToString(pvd.volume_set_id, encoding).TrimEnd(),
|
||||
PublisherIdentifier = StringHandlers.CToString(pvd.publisher_id, encoding).TrimEnd(),
|
||||
DataPreparerIdentifier = StringHandlers.CToString(pvd.preparer_id, encoding).TrimEnd(),
|
||||
SystemIdentifier = StringHandlers.CToString(pvd.system_id, encoding).TrimEnd(),
|
||||
VolumeIdentifier = StringHandlers.CToString(pvd.volume_id, encoding).TrimEnd(),
|
||||
VolumeSetIdentifier = StringHandlers.CToString(pvd.volume_set_id, encoding).TrimEnd(),
|
||||
PublisherIdentifier = StringHandlers.CToString(pvd.publisher_id, encoding).TrimEnd(),
|
||||
DataPreparerIdentifier = StringHandlers.CToString(pvd.preparer_id, encoding).TrimEnd(),
|
||||
ApplicationIdentifier = StringHandlers.CToString(pvd.application_id, encoding).TrimEnd()
|
||||
};
|
||||
|
||||
@@ -91,6 +91,143 @@ public sealed partial class ISO9660
|
||||
return decodedVd;
|
||||
}
|
||||
|
||||
#region Nested type: BootRecord
|
||||
|
||||
[StructLayout(LayoutKind.Sequential, Pack = 1)]
|
||||
readonly struct BootRecord
|
||||
{
|
||||
public readonly byte type;
|
||||
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 5)]
|
||||
public readonly byte[] id;
|
||||
public readonly byte version;
|
||||
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 32)]
|
||||
public readonly byte[] system_id;
|
||||
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 32)]
|
||||
public readonly byte[] boot_id;
|
||||
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 1977)]
|
||||
public readonly byte[] boot_use;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Nested type: DirectoryRecord
|
||||
|
||||
[StructLayout(LayoutKind.Sequential, Pack = 1)]
|
||||
readonly struct DirectoryRecord
|
||||
{
|
||||
public readonly byte length;
|
||||
public readonly byte xattr_len;
|
||||
public readonly uint extent;
|
||||
public readonly uint extent_be;
|
||||
public readonly uint size;
|
||||
public readonly uint size_be;
|
||||
public readonly IsoTimestamp date;
|
||||
public readonly FileFlags flags;
|
||||
public readonly byte file_unit_size;
|
||||
public readonly byte interleave;
|
||||
public readonly ushort volume_sequence_number;
|
||||
public readonly ushort volume_sequence_number_be;
|
||||
public readonly byte name_len;
|
||||
|
||||
// Followed by name[name_len] and then system area until length arrives
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Nested type: ExtendedAttributeRecord
|
||||
|
||||
[StructLayout(LayoutKind.Sequential, Pack = 1)]
|
||||
readonly struct ExtendedAttributeRecord
|
||||
{
|
||||
public readonly ushort owner;
|
||||
public readonly ushort owner_be;
|
||||
public readonly ushort group;
|
||||
public readonly ushort group_be;
|
||||
public readonly Permissions permissions;
|
||||
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 17)]
|
||||
public readonly byte[] creation_date;
|
||||
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 17)]
|
||||
public readonly byte[] modification_date;
|
||||
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 17)]
|
||||
public readonly byte[] expiration_date;
|
||||
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 17)]
|
||||
public readonly byte[] effective_date;
|
||||
public readonly RecordFormat record_format;
|
||||
public readonly RecordAttribute record_attributes;
|
||||
public readonly ushort record_length;
|
||||
public readonly ushort record_length_be;
|
||||
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 32)]
|
||||
public readonly byte[] system_id;
|
||||
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 32)]
|
||||
public readonly byte[] system_use;
|
||||
public readonly byte record_version;
|
||||
public readonly byte escape_len;
|
||||
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 32)]
|
||||
public readonly byte[] reserved1;
|
||||
public readonly ushort app_use_len;
|
||||
public readonly ushort app_use_len_be;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Nested type: IsoTimestamp
|
||||
|
||||
[StructLayout(LayoutKind.Sequential, Pack = 1)]
|
||||
readonly struct IsoTimestamp
|
||||
{
|
||||
public readonly byte Years;
|
||||
public readonly byte Month;
|
||||
public readonly byte Day;
|
||||
public readonly byte Hour;
|
||||
public readonly byte Minute;
|
||||
public readonly byte Second;
|
||||
public readonly sbyte GmtOffset;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Nested type: PartitionDescriptor
|
||||
|
||||
[StructLayout(LayoutKind.Sequential, Pack = 1)]
|
||||
readonly struct PartitionDescriptor
|
||||
{
|
||||
public readonly byte type;
|
||||
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 5)]
|
||||
public readonly byte[] id;
|
||||
public readonly byte version;
|
||||
public readonly byte reserved1;
|
||||
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 32)]
|
||||
public readonly byte[] system_id;
|
||||
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 32)]
|
||||
public readonly byte[] partition_id;
|
||||
public readonly uint partition_location;
|
||||
public readonly uint partition_location_be;
|
||||
public readonly uint partition_size;
|
||||
public readonly uint partition_size_be;
|
||||
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 1960)]
|
||||
public readonly byte[] system_use;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Nested type: PathTableEntry
|
||||
|
||||
// There are two tables one in little endian one in big endian
|
||||
[StructLayout(LayoutKind.Sequential, Pack = 1)]
|
||||
readonly struct PathTableEntry
|
||||
{
|
||||
public readonly byte name_len;
|
||||
public readonly byte xattr_len;
|
||||
public readonly uint start_lbn;
|
||||
public readonly ushort parent_dirno;
|
||||
|
||||
// Followed by name[name_len]
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Nested type: PrimaryVolumeDescriptor
|
||||
|
||||
[StructLayout(LayoutKind.Sequential, Pack = 1)]
|
||||
readonly struct PrimaryVolumeDescriptor
|
||||
{
|
||||
@@ -156,114 +293,5 @@ public sealed partial class ISO9660
|
||||
public readonly byte[] reserved3;
|
||||
}
|
||||
|
||||
[StructLayout(LayoutKind.Sequential, Pack = 1)]
|
||||
readonly struct BootRecord
|
||||
{
|
||||
public readonly byte type;
|
||||
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 5)]
|
||||
public readonly byte[] id;
|
||||
public readonly byte version;
|
||||
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 32)]
|
||||
public readonly byte[] system_id;
|
||||
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 32)]
|
||||
public readonly byte[] boot_id;
|
||||
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 1977)]
|
||||
public readonly byte[] boot_use;
|
||||
}
|
||||
|
||||
[StructLayout(LayoutKind.Sequential, Pack = 1)]
|
||||
readonly struct PartitionDescriptor
|
||||
{
|
||||
public readonly byte type;
|
||||
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 5)]
|
||||
public readonly byte[] id;
|
||||
public readonly byte version;
|
||||
public readonly byte reserved1;
|
||||
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 32)]
|
||||
public readonly byte[] system_id;
|
||||
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 32)]
|
||||
public readonly byte[] partition_id;
|
||||
public readonly uint partition_location;
|
||||
public readonly uint partition_location_be;
|
||||
public readonly uint partition_size;
|
||||
public readonly uint partition_size_be;
|
||||
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 1960)]
|
||||
public readonly byte[] system_use;
|
||||
}
|
||||
|
||||
[StructLayout(LayoutKind.Sequential, Pack = 1)]
|
||||
readonly struct DirectoryRecord
|
||||
{
|
||||
public readonly byte length;
|
||||
public readonly byte xattr_len;
|
||||
public readonly uint extent;
|
||||
public readonly uint extent_be;
|
||||
public readonly uint size;
|
||||
public readonly uint size_be;
|
||||
public readonly IsoTimestamp date;
|
||||
public readonly FileFlags flags;
|
||||
public readonly byte file_unit_size;
|
||||
public readonly byte interleave;
|
||||
public readonly ushort volume_sequence_number;
|
||||
public readonly ushort volume_sequence_number_be;
|
||||
public readonly byte name_len;
|
||||
|
||||
// Followed by name[name_len] and then system area until length arrives
|
||||
}
|
||||
|
||||
[StructLayout(LayoutKind.Sequential, Pack = 1)]
|
||||
readonly struct ExtendedAttributeRecord
|
||||
{
|
||||
public readonly ushort owner;
|
||||
public readonly ushort owner_be;
|
||||
public readonly ushort group;
|
||||
public readonly ushort group_be;
|
||||
public readonly Permissions permissions;
|
||||
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 17)]
|
||||
public readonly byte[] creation_date;
|
||||
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 17)]
|
||||
public readonly byte[] modification_date;
|
||||
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 17)]
|
||||
public readonly byte[] expiration_date;
|
||||
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 17)]
|
||||
public readonly byte[] effective_date;
|
||||
public readonly RecordFormat record_format;
|
||||
public readonly RecordAttribute record_attributes;
|
||||
public readonly ushort record_length;
|
||||
public readonly ushort record_length_be;
|
||||
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 32)]
|
||||
public readonly byte[] system_id;
|
||||
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 32)]
|
||||
public readonly byte[] system_use;
|
||||
public readonly byte record_version;
|
||||
public readonly byte escape_len;
|
||||
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 32)]
|
||||
public readonly byte[] reserved1;
|
||||
public readonly ushort app_use_len;
|
||||
public readonly ushort app_use_len_be;
|
||||
}
|
||||
|
||||
// There are two tables one in little endian one in big endian
|
||||
[StructLayout(LayoutKind.Sequential, Pack = 1)]
|
||||
readonly struct PathTableEntry
|
||||
{
|
||||
public readonly byte name_len;
|
||||
public readonly byte xattr_len;
|
||||
public readonly uint start_lbn;
|
||||
public readonly ushort parent_dirno;
|
||||
|
||||
// Followed by name[name_len]
|
||||
}
|
||||
|
||||
[StructLayout(LayoutKind.Sequential, Pack = 1)]
|
||||
readonly struct IsoTimestamp
|
||||
{
|
||||
public readonly byte Years;
|
||||
public readonly byte Month;
|
||||
public readonly byte Day;
|
||||
public readonly byte Hour;
|
||||
public readonly byte Minute;
|
||||
public readonly byte Second;
|
||||
public readonly sbyte GmtOffset;
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
Reference in New Issue
Block a user