mirror of
https://github.com/aaru-dps/Aaru.git
synced 2025-12-16 19:24:25 +00:00
Add support for Human68k 18.3 filenames in FAT.
This commit is contained in:
@@ -867,6 +867,22 @@ namespace DiscImageChef.Filesystems.FAT
|
||||
public readonly uint size;
|
||||
}
|
||||
|
||||
[StructLayout(LayoutKind.Sequential, Pack = 1)]
|
||||
struct HumanDirectoryEntry
|
||||
{
|
||||
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 8)]
|
||||
public readonly byte[] name1;
|
||||
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 3)]
|
||||
public readonly byte[] extension;
|
||||
public readonly FatAttributes attributes;
|
||||
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 10)]
|
||||
public readonly byte[] name2;
|
||||
public readonly ushort mtime;
|
||||
public readonly ushort mdate;
|
||||
public readonly ushort start_cluster;
|
||||
public readonly uint size;
|
||||
}
|
||||
|
||||
[StructLayout(LayoutKind.Sequential, Pack = 1)]
|
||||
struct LfnEntry
|
||||
{
|
||||
@@ -897,17 +913,22 @@ namespace DiscImageChef.Filesystems.FAT
|
||||
|
||||
class CompleteDirectoryEntry
|
||||
{
|
||||
public DirectoryEntry Dirent;
|
||||
public DirectoryEntry Fat32Ea;
|
||||
public string Lfn;
|
||||
public string Longname;
|
||||
public string Shortname;
|
||||
public DirectoryEntry Dirent;
|
||||
public DirectoryEntry Fat32Ea;
|
||||
public HumanDirectoryEntry HumanDirent;
|
||||
public string HumanName;
|
||||
public string Lfn;
|
||||
public string Longname;
|
||||
public string Shortname;
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
// This ensures LFN takes preference when eCS is in use
|
||||
if(!string.IsNullOrEmpty(Lfn)) return Lfn;
|
||||
|
||||
// This ensures Humans takes preference when present
|
||||
if(!string.IsNullOrEmpty(HumanName)) return HumanName;
|
||||
|
||||
return !string.IsNullOrEmpty(Longname) ? Longname : Shortname;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user