mirror of
https://github.com/aaru-dps/Aaru.git
synced 2025-12-16 19:24:25 +00:00
Invert 'if' statement to reduce nesting.
This commit is contained in:
Submodule Aaru.Checksums updated: 3429b9012b...29c9f29554
Submodule Aaru.CommonTypes updated: 47294b2f62...d841ec2800
@@ -319,12 +319,12 @@ public class TeleDiskLzh
|
||||
|
||||
for(i = 0; i < T; i++)
|
||||
{
|
||||
if(_son[i] >= T)
|
||||
{
|
||||
_freq[j] = (ushort)((_freq[i] + 1) / 2);
|
||||
_son[j] = _son[i];
|
||||
j++;
|
||||
}
|
||||
if(_son[i] < T)
|
||||
continue;
|
||||
|
||||
_freq[j] = (ushort)((_freq[i] + 1) / 2);
|
||||
_son[j] = _son[i];
|
||||
j++;
|
||||
}
|
||||
|
||||
/* make a tree : first, connect children nodes */
|
||||
|
||||
Submodule Aaru.Decoders updated: 99e85ca762...629ed3dcd9
@@ -386,14 +386,14 @@ public sealed partial class FAT
|
||||
{
|
||||
for(var c = 0; c < 11; c++)
|
||||
{
|
||||
if(rootDir[c + e] < 0x20 && rootDir[c + e] != 0x00 && rootDir[c + e] != 0x05 ||
|
||||
rootDir[c + e] == 0xFF ||
|
||||
rootDir[c + e] == 0x2E)
|
||||
{
|
||||
validRootDir = false;
|
||||
if((rootDir[c + e] >= 0x20 || rootDir[c + e] == 0x00 || rootDir[c + e] == 0x05) &&
|
||||
rootDir[c + e] != 0xFF &&
|
||||
rootDir[c + e] != 0x2E)
|
||||
continue;
|
||||
|
||||
break;
|
||||
}
|
||||
validRootDir = false;
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
if(!validRootDir)
|
||||
|
||||
@@ -331,14 +331,14 @@ public sealed partial class FAT
|
||||
{
|
||||
for(var c = 0; c < 11; c++)
|
||||
{
|
||||
if(rootDir[c + e] < 0x20 && rootDir[c + e] != 0x00 && rootDir[c + e] != 0x05 ||
|
||||
rootDir[c + e] == 0xFF ||
|
||||
rootDir[c + e] == 0x2E)
|
||||
{
|
||||
validRootDir = false;
|
||||
if((rootDir[c + e] >= 0x20 || rootDir[c + e] == 0x00 || rootDir[c + e] == 0x05) &&
|
||||
rootDir[c + e] != 0xFF &&
|
||||
rootDir[c + e] != 0x2E)
|
||||
continue;
|
||||
|
||||
break;
|
||||
}
|
||||
validRootDir = false;
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
if(!validRootDir)
|
||||
|
||||
@@ -126,50 +126,50 @@ public sealed partial class NintendoPlugin
|
||||
|
||||
for(var i = 0; i < fields.FirstPartitions.Length; i++)
|
||||
{
|
||||
if(offset1 + i * 8 + 8 < 0x50000)
|
||||
{
|
||||
fields.FirstPartitions[i].Offset =
|
||||
BigEndianBitConverter.ToUInt32(header, (int)(offset1 + i * 8 + 0)) << 2;
|
||||
if(offset1 + i * 8 + 8 >= 0x50000)
|
||||
continue;
|
||||
|
||||
fields.FirstPartitions[i].Type =
|
||||
BigEndianBitConverter.ToUInt32(header, (int)(offset1 + i * 8 + 4));
|
||||
}
|
||||
fields.FirstPartitions[i].Offset =
|
||||
BigEndianBitConverter.ToUInt32(header, (int)(offset1 + i * 8 + 0)) << 2;
|
||||
|
||||
fields.FirstPartitions[i].Type =
|
||||
BigEndianBitConverter.ToUInt32(header, (int)(offset1 + i * 8 + 4));
|
||||
}
|
||||
|
||||
for(var i = 0; i < fields.SecondPartitions.Length; i++)
|
||||
{
|
||||
if(offset1 + i * 8 + 8 < 0x50000)
|
||||
{
|
||||
fields.FirstPartitions[i].Offset =
|
||||
BigEndianBitConverter.ToUInt32(header, (int)(offset2 + i * 8 + 0)) << 2;
|
||||
if(offset1 + i * 8 + 8 >= 0x50000)
|
||||
continue;
|
||||
|
||||
fields.FirstPartitions[i].Type =
|
||||
BigEndianBitConverter.ToUInt32(header, (int)(offset2 + i * 8 + 4));
|
||||
}
|
||||
fields.FirstPartitions[i].Offset =
|
||||
BigEndianBitConverter.ToUInt32(header, (int)(offset2 + i * 8 + 0)) << 2;
|
||||
|
||||
fields.FirstPartitions[i].Type =
|
||||
BigEndianBitConverter.ToUInt32(header, (int)(offset2 + i * 8 + 4));
|
||||
}
|
||||
|
||||
for(var i = 0; i < fields.ThirdPartitions.Length; i++)
|
||||
{
|
||||
if(offset1 + i * 8 + 8 < 0x50000)
|
||||
{
|
||||
fields.FirstPartitions[i].Offset =
|
||||
BigEndianBitConverter.ToUInt32(header, (int)(offset3 + i * 8 + 0)) << 2;
|
||||
if(offset1 + i * 8 + 8 >= 0x50000)
|
||||
continue;
|
||||
|
||||
fields.FirstPartitions[i].Type =
|
||||
BigEndianBitConverter.ToUInt32(header, (int)(offset3 + i * 8 + 4));
|
||||
}
|
||||
fields.FirstPartitions[i].Offset =
|
||||
BigEndianBitConverter.ToUInt32(header, (int)(offset3 + i * 8 + 0)) << 2;
|
||||
|
||||
fields.FirstPartitions[i].Type =
|
||||
BigEndianBitConverter.ToUInt32(header, (int)(offset3 + i * 8 + 4));
|
||||
}
|
||||
|
||||
for(var i = 0; i < fields.FourthPartitions.Length; i++)
|
||||
{
|
||||
if(offset1 + i * 8 + 8 < 0x50000)
|
||||
{
|
||||
fields.FirstPartitions[i].Offset =
|
||||
BigEndianBitConverter.ToUInt32(header, (int)(offset4 + i * 8 + 0)) << 2;
|
||||
if(offset1 + i * 8 + 8 >= 0x50000)
|
||||
continue;
|
||||
|
||||
fields.FirstPartitions[i].Type =
|
||||
BigEndianBitConverter.ToUInt32(header, (int)(offset4 + i * 8 + 4));
|
||||
}
|
||||
fields.FirstPartitions[i].Offset =
|
||||
BigEndianBitConverter.ToUInt32(header, (int)(offset4 + i * 8 + 0)) << 2;
|
||||
|
||||
fields.FirstPartitions[i].Type =
|
||||
BigEndianBitConverter.ToUInt32(header, (int)(offset4 + i * 8 + 4));
|
||||
}
|
||||
|
||||
fields.Region = header[0x4E000];
|
||||
|
||||
@@ -644,55 +644,54 @@ public sealed class MainWindowViewModel : ViewModelBase
|
||||
|
||||
foreach(string pluginName in idPlugins)
|
||||
{
|
||||
if(plugins.Filesystems.TryGetValue(pluginName, out pluginType))
|
||||
if(!plugins.Filesystems.TryGetValue(pluginName, out pluginType))
|
||||
continue;
|
||||
if(Activator.CreateInstance(pluginType) is not IFilesystem fs)
|
||||
continue;
|
||||
|
||||
fs.GetInformation(imageFormat, partition, null, out string information,
|
||||
out CommonTypes.AaruMetadata.FileSystem fsMetadata);
|
||||
|
||||
var rofs = fs as IReadOnlyFilesystem;
|
||||
|
||||
if(rofs != null)
|
||||
{
|
||||
if(Activator.CreateInstance(pluginType) is not IFilesystem fs)
|
||||
continue;
|
||||
ErrorNumber error =
|
||||
rofs.Mount(imageFormat, partition, null,
|
||||
new Dictionary<string, string>(), null);
|
||||
|
||||
fs.GetInformation(imageFormat, partition, null, out string information,
|
||||
out CommonTypes.AaruMetadata.FileSystem fsMetadata);
|
||||
|
||||
var rofs = fs as IReadOnlyFilesystem;
|
||||
|
||||
if(rofs != null)
|
||||
{
|
||||
ErrorNumber error =
|
||||
rofs.Mount(imageFormat, partition, null,
|
||||
new Dictionary<string, string>(), null);
|
||||
|
||||
if(error != ErrorNumber.NoError)
|
||||
rofs = null;
|
||||
}
|
||||
|
||||
var filesystemModel = new FileSystemModel
|
||||
{
|
||||
VolumeName = rofs?.Metadata.VolumeName is null
|
||||
? fsMetadata.VolumeName is null
|
||||
? $"{fsMetadata.Type}"
|
||||
: $"{fsMetadata.VolumeName} ({fsMetadata.Type})"
|
||||
: $"{rofs.Metadata.VolumeName} ({rofs.Metadata.Type})",
|
||||
Filesystem = fs,
|
||||
ReadOnlyFilesystem = rofs,
|
||||
ViewModel = new FileSystemViewModel(rofs?.Metadata ?? fsMetadata,
|
||||
information)
|
||||
};
|
||||
|
||||
// TODO: Trap expanding item
|
||||
if(rofs != null)
|
||||
{
|
||||
filesystemModel.Roots.Add(new SubdirectoryModel
|
||||
{
|
||||
Name = "/",
|
||||
Path = "",
|
||||
Plugin = rofs
|
||||
});
|
||||
|
||||
Statistics.AddCommand("ls");
|
||||
}
|
||||
|
||||
Statistics.AddFilesystem(rofs?.Metadata.Type ?? fsMetadata.Type);
|
||||
partitionModel.FileSystems.Add(filesystemModel);
|
||||
if(error != ErrorNumber.NoError)
|
||||
rofs = null;
|
||||
}
|
||||
|
||||
var filesystemModel = new FileSystemModel
|
||||
{
|
||||
VolumeName = rofs?.Metadata.VolumeName is null
|
||||
? fsMetadata.VolumeName is null
|
||||
? $"{fsMetadata.Type}"
|
||||
: $"{fsMetadata.VolumeName} ({fsMetadata.Type})"
|
||||
: $"{rofs.Metadata.VolumeName} ({rofs.Metadata.Type})",
|
||||
Filesystem = fs,
|
||||
ReadOnlyFilesystem = rofs,
|
||||
ViewModel = new FileSystemViewModel(rofs?.Metadata ?? fsMetadata,
|
||||
information)
|
||||
};
|
||||
|
||||
// TODO: Trap expanding item
|
||||
if(rofs != null)
|
||||
{
|
||||
filesystemModel.Roots.Add(new SubdirectoryModel
|
||||
{
|
||||
Name = "/",
|
||||
Path = "",
|
||||
Plugin = rofs
|
||||
});
|
||||
|
||||
Statistics.AddCommand("ls");
|
||||
}
|
||||
|
||||
Statistics.AddFilesystem(rofs?.Metadata.Type ?? fsMetadata.Type);
|
||||
partitionModel.FileSystems.Add(filesystemModel);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -722,53 +721,52 @@ public sealed class MainWindowViewModel : ViewModelBase
|
||||
|
||||
foreach(string pluginName in idPlugins)
|
||||
{
|
||||
if(plugins.Filesystems.TryGetValue(pluginName, out pluginType))
|
||||
if(!plugins.Filesystems.TryGetValue(pluginName, out pluginType))
|
||||
continue;
|
||||
if(Activator.CreateInstance(pluginType) is not IFilesystem fs)
|
||||
continue;
|
||||
|
||||
fs.GetInformation(imageFormat, wholePart, null, out string information,
|
||||
out CommonTypes.AaruMetadata.FileSystem fsMetadata);
|
||||
|
||||
var rofs = fs as IReadOnlyFilesystem;
|
||||
|
||||
if(rofs != null)
|
||||
{
|
||||
if(Activator.CreateInstance(pluginType) is not IFilesystem fs)
|
||||
continue;
|
||||
ErrorNumber error = rofs.Mount(imageFormat, wholePart, null,
|
||||
new Dictionary<string, string>(), null);
|
||||
|
||||
fs.GetInformation(imageFormat, wholePart, null, out string information,
|
||||
out CommonTypes.AaruMetadata.FileSystem fsMetadata);
|
||||
|
||||
var rofs = fs as IReadOnlyFilesystem;
|
||||
|
||||
if(rofs != null)
|
||||
{
|
||||
ErrorNumber error = rofs.Mount(imageFormat, wholePart, null,
|
||||
new Dictionary<string, string>(), null);
|
||||
|
||||
if(error != ErrorNumber.NoError)
|
||||
rofs = null;
|
||||
}
|
||||
|
||||
var filesystemModel = new FileSystemModel
|
||||
{
|
||||
VolumeName = rofs?.Metadata.VolumeName is null
|
||||
? fsMetadata.VolumeName is null
|
||||
? $"{fsMetadata.Type}"
|
||||
: $"{fsMetadata.VolumeName} ({fsMetadata.Type})"
|
||||
: $"{rofs.Metadata.VolumeName} ({rofs.Metadata.Type})",
|
||||
Filesystem = fs,
|
||||
ReadOnlyFilesystem = rofs,
|
||||
ViewModel = new FileSystemViewModel(rofs?.Metadata ?? fsMetadata, information)
|
||||
};
|
||||
|
||||
// TODO: Trap expanding item
|
||||
if(rofs != null)
|
||||
{
|
||||
filesystemModel.Roots.Add(new SubdirectoryModel
|
||||
{
|
||||
Name = "/",
|
||||
Path = "",
|
||||
Plugin = rofs
|
||||
});
|
||||
|
||||
Statistics.AddCommand("ls");
|
||||
}
|
||||
|
||||
Statistics.AddFilesystem(rofs?.Metadata.Type ?? fsMetadata.Type);
|
||||
imageModel.PartitionSchemesOrFileSystems.Add(filesystemModel);
|
||||
if(error != ErrorNumber.NoError)
|
||||
rofs = null;
|
||||
}
|
||||
|
||||
var filesystemModel = new FileSystemModel
|
||||
{
|
||||
VolumeName = rofs?.Metadata.VolumeName is null
|
||||
? fsMetadata.VolumeName is null
|
||||
? $"{fsMetadata.Type}"
|
||||
: $"{fsMetadata.VolumeName} ({fsMetadata.Type})"
|
||||
: $"{rofs.Metadata.VolumeName} ({rofs.Metadata.Type})",
|
||||
Filesystem = fs,
|
||||
ReadOnlyFilesystem = rofs,
|
||||
ViewModel = new FileSystemViewModel(rofs?.Metadata ?? fsMetadata, information)
|
||||
};
|
||||
|
||||
// TODO: Trap expanding item
|
||||
if(rofs != null)
|
||||
{
|
||||
filesystemModel.Roots.Add(new SubdirectoryModel
|
||||
{
|
||||
Name = "/",
|
||||
Path = "",
|
||||
Plugin = rofs
|
||||
});
|
||||
|
||||
Statistics.AddCommand("ls");
|
||||
}
|
||||
|
||||
Statistics.AddFilesystem(rofs?.Metadata.Type ?? fsMetadata.Type);
|
||||
imageModel.PartitionSchemesOrFileSystems.Add(filesystemModel);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Submodule Aaru.Helpers updated: 57ad637c20...6f76a5d460
@@ -772,19 +772,19 @@ public sealed partial class Alcohol120
|
||||
|
||||
foreach(KeyValuePair<uint, ulong> kvp in _offsetMap)
|
||||
{
|
||||
if(sectorAddress >= kvp.Value)
|
||||
if(sectorAddress < kvp.Value)
|
||||
continue;
|
||||
|
||||
foreach(Track track in _alcTracks.Values)
|
||||
{
|
||||
foreach(Track track in _alcTracks.Values)
|
||||
{
|
||||
if(track.point != kvp.Key ||
|
||||
!_alcTrackExtras.TryGetValue(track.point, out TrackExtra extra))
|
||||
continue;
|
||||
if(track.point != kvp.Key ||
|
||||
!_alcTrackExtras.TryGetValue(track.point, out TrackExtra extra))
|
||||
continue;
|
||||
|
||||
if(sectorAddress - kvp.Value >= extra.sectors + extra.pregap)
|
||||
continue;
|
||||
if(sectorAddress - kvp.Value >= extra.sectors + extra.pregap)
|
||||
continue;
|
||||
|
||||
return ReadSectors(sectorAddress - kvp.Value, length, kvp.Key, out buffer);
|
||||
}
|
||||
return ReadSectors(sectorAddress - kvp.Value, length, kvp.Key, out buffer);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -798,19 +798,19 @@ public sealed partial class Alcohol120
|
||||
|
||||
foreach(KeyValuePair<uint, ulong> kvp in _offsetMap)
|
||||
{
|
||||
if(sectorAddress >= kvp.Value)
|
||||
if(sectorAddress < kvp.Value)
|
||||
continue;
|
||||
|
||||
foreach(Track track in _alcTracks.Values)
|
||||
{
|
||||
foreach(Track track in _alcTracks.Values)
|
||||
{
|
||||
if(track.point != kvp.Key ||
|
||||
!_alcTrackExtras.TryGetValue(track.point, out TrackExtra extra))
|
||||
continue;
|
||||
if(track.point != kvp.Key ||
|
||||
!_alcTrackExtras.TryGetValue(track.point, out TrackExtra extra))
|
||||
continue;
|
||||
|
||||
if(sectorAddress - kvp.Value >= extra.sectors + extra.pregap)
|
||||
continue;
|
||||
if(sectorAddress - kvp.Value >= extra.sectors + extra.pregap)
|
||||
continue;
|
||||
|
||||
return ReadSectorsTag(sectorAddress - kvp.Value, length, kvp.Key, tag, out buffer);
|
||||
}
|
||||
return ReadSectorsTag(sectorAddress - kvp.Value, length, kvp.Key, tag, out buffer);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1390,19 +1390,19 @@ public sealed partial class Alcohol120
|
||||
|
||||
foreach(KeyValuePair<uint, ulong> kvp in _offsetMap)
|
||||
{
|
||||
if(sectorAddress >= kvp.Value)
|
||||
if(sectorAddress < kvp.Value)
|
||||
continue;
|
||||
|
||||
foreach(Track alcTrack in _alcTracks.Values)
|
||||
{
|
||||
foreach(Track alcTrack in _alcTracks.Values)
|
||||
{
|
||||
if(alcTrack.point != kvp.Key ||
|
||||
!_alcTrackExtras.TryGetValue(alcTrack.point, out TrackExtra alcExtra))
|
||||
continue;
|
||||
if(alcTrack.point != kvp.Key ||
|
||||
!_alcTrackExtras.TryGetValue(alcTrack.point, out TrackExtra alcExtra))
|
||||
continue;
|
||||
|
||||
if(sectorAddress - kvp.Value >= alcExtra.sectors + alcExtra.pregap)
|
||||
continue;
|
||||
if(sectorAddress - kvp.Value >= alcExtra.sectors + alcExtra.pregap)
|
||||
continue;
|
||||
|
||||
return ReadSectorsLong(sectorAddress - kvp.Value, length, kvp.Key, out buffer);
|
||||
}
|
||||
return ReadSectorsLong(sectorAddress - kvp.Value, length, kvp.Key, out buffer);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1010,19 +1010,19 @@ public sealed partial class CdrWin
|
||||
|
||||
for(var i = 0; i < cueTracks.Length; i++)
|
||||
{
|
||||
if(cueTracks[i].Session == s)
|
||||
if(cueTracks[i].Session != s)
|
||||
continue;
|
||||
|
||||
if(!firstTrackRead)
|
||||
{
|
||||
if(!firstTrackRead)
|
||||
{
|
||||
firstSessionTrk = i;
|
||||
firstTrackRead = true;
|
||||
}
|
||||
|
||||
sessionSectors += cueTracks[i].Sectors;
|
||||
|
||||
if(i > lastSessionTrack)
|
||||
lastSessionTrack = i;
|
||||
firstSessionTrk = i;
|
||||
firstTrackRead = true;
|
||||
}
|
||||
|
||||
sessionSectors += cueTracks[i].Sectors;
|
||||
|
||||
if(i > lastSessionTrack)
|
||||
lastSessionTrack = i;
|
||||
}
|
||||
|
||||
if(s > 1)
|
||||
@@ -1691,13 +1691,13 @@ public sealed partial class CdrWin
|
||||
|
||||
for(var s = 0; s < sessions.Length; s++)
|
||||
{
|
||||
if(sessions[s].Sequence > 1 &&
|
||||
track.Sequence == sessions[s].StartTrack)
|
||||
{
|
||||
track.TrackFile.Offset += 307200;
|
||||
track.Sectors -= 150;
|
||||
sessions[s].StartSector = (ulong)track.Indexes[1];
|
||||
}
|
||||
if(sessions[s].Sequence <= 1 ||
|
||||
track.Sequence != sessions[s].StartTrack)
|
||||
continue;
|
||||
|
||||
track.TrackFile.Offset += 307200;
|
||||
track.Sectors -= 150;
|
||||
sessions[s].StartSector = (ulong)track.Indexes[1];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -127,40 +127,40 @@ public sealed partial class Dart
|
||||
|
||||
foreach(short l in bLength)
|
||||
{
|
||||
if(l != 0)
|
||||
{
|
||||
var buffer = new byte[BUFFER_SIZE];
|
||||
if(l == 0)
|
||||
continue;
|
||||
|
||||
if(l == -1)
|
||||
var buffer = new byte[BUFFER_SIZE];
|
||||
|
||||
if(l == -1)
|
||||
{
|
||||
stream.EnsureRead(buffer, 0, BUFFER_SIZE);
|
||||
dataMs.Write(buffer, 0, DATA_SIZE);
|
||||
tagMs.Write(buffer, DATA_SIZE, TAG_SIZE);
|
||||
}
|
||||
else
|
||||
{
|
||||
byte[] temp;
|
||||
|
||||
if(header.srcCmp == COMPRESS_RLE)
|
||||
{
|
||||
stream.EnsureRead(buffer, 0, BUFFER_SIZE);
|
||||
temp = new byte[l * 2];
|
||||
stream.EnsureRead(temp, 0, temp.Length);
|
||||
buffer = new byte[BUFFER_SIZE];
|
||||
|
||||
AppleRle.DecodeBuffer(temp, buffer);
|
||||
|
||||
dataMs.Write(buffer, 0, DATA_SIZE);
|
||||
tagMs.Write(buffer, DATA_SIZE, TAG_SIZE);
|
||||
}
|
||||
else
|
||||
{
|
||||
byte[] temp;
|
||||
temp = new byte[l];
|
||||
stream.EnsureRead(temp, 0, temp.Length);
|
||||
|
||||
if(header.srcCmp == COMPRESS_RLE)
|
||||
{
|
||||
temp = new byte[l * 2];
|
||||
stream.EnsureRead(temp, 0, temp.Length);
|
||||
buffer = new byte[BUFFER_SIZE];
|
||||
AaruConsole.ErrorWriteLine(Localization.LZH_Compressed_images_not_yet_supported);
|
||||
|
||||
AppleRle.DecodeBuffer(temp, buffer);
|
||||
|
||||
dataMs.Write(buffer, 0, DATA_SIZE);
|
||||
tagMs.Write(buffer, DATA_SIZE, TAG_SIZE);
|
||||
}
|
||||
else
|
||||
{
|
||||
temp = new byte[l];
|
||||
stream.EnsureRead(temp, 0, temp.Length);
|
||||
|
||||
AaruConsole.ErrorWriteLine(Localization.LZH_Compressed_images_not_yet_supported);
|
||||
|
||||
return ErrorNumber.NotImplemented;
|
||||
}
|
||||
return ErrorNumber.NotImplemented;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -929,29 +929,29 @@ public sealed partial class Gdi
|
||||
|
||||
foreach(GdiTrack gdiTrack in _discImage.Tracks)
|
||||
{
|
||||
if(gdiTrack.HighDensity == expectedDensity)
|
||||
if(gdiTrack.HighDensity != expectedDensity)
|
||||
continue;
|
||||
|
||||
var track = new Track
|
||||
{
|
||||
var track = new Track
|
||||
{
|
||||
Description = null,
|
||||
StartSector = gdiTrack.StartSector,
|
||||
Pregap = gdiTrack.Pregap,
|
||||
Session = (ushort)(gdiTrack.HighDensity ? 2 : 1),
|
||||
Sequence = gdiTrack.Sequence,
|
||||
Type = gdiTrack.TrackType,
|
||||
Filter = gdiTrack.TrackFilter,
|
||||
File = gdiTrack.TrackFile,
|
||||
FileOffset = (ulong)gdiTrack.Offset,
|
||||
FileType = "BINARY",
|
||||
RawBytesPerSector = gdiTrack.Bps,
|
||||
BytesPerSector = gdiTrack.TrackType == TrackType.Data ? 2048 : 2352,
|
||||
SubchannelType = TrackSubchannelType.None
|
||||
};
|
||||
Description = null,
|
||||
StartSector = gdiTrack.StartSector,
|
||||
Pregap = gdiTrack.Pregap,
|
||||
Session = (ushort)(gdiTrack.HighDensity ? 2 : 1),
|
||||
Sequence = gdiTrack.Sequence,
|
||||
Type = gdiTrack.TrackType,
|
||||
Filter = gdiTrack.TrackFilter,
|
||||
File = gdiTrack.TrackFile,
|
||||
FileOffset = (ulong)gdiTrack.Offset,
|
||||
FileType = "BINARY",
|
||||
RawBytesPerSector = gdiTrack.Bps,
|
||||
BytesPerSector = gdiTrack.TrackType == TrackType.Data ? 2048 : 2352,
|
||||
SubchannelType = TrackSubchannelType.None
|
||||
};
|
||||
|
||||
track.EndSector = track.StartSector + gdiTrack.Sectors - 1;
|
||||
track.EndSector = track.StartSector + gdiTrack.Sectors - 1;
|
||||
|
||||
tracks.Add(track);
|
||||
}
|
||||
tracks.Add(track);
|
||||
}
|
||||
|
||||
return tracks;
|
||||
|
||||
@@ -194,12 +194,12 @@ public sealed partial class PartClone
|
||||
|
||||
for(uint i = 0; i < length; i++)
|
||||
{
|
||||
if(_byteMap[sectorAddress + i] != 0)
|
||||
{
|
||||
allEmpty = false;
|
||||
if(_byteMap[sectorAddress + i] == 0)
|
||||
continue;
|
||||
|
||||
break;
|
||||
}
|
||||
allEmpty = false;
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
if(allEmpty)
|
||||
|
||||
@@ -445,12 +445,12 @@ public sealed partial class Partimage
|
||||
|
||||
for(uint i = 0; i < length; i++)
|
||||
{
|
||||
if((_bitmap[sectorAddress / 8] & 1 << (int)(sectorAddress % 8)) != 0)
|
||||
{
|
||||
allEmpty = false;
|
||||
if((_bitmap[sectorAddress / 8] & 1 << (int)(sectorAddress % 8)) == 0)
|
||||
continue;
|
||||
|
||||
break;
|
||||
}
|
||||
allEmpty = false;
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
if(allEmpty)
|
||||
|
||||
@@ -193,26 +193,26 @@ public sealed class SunDisklabel : IPartition
|
||||
|
||||
for(var i = 0; i < NDKMAP; i++)
|
||||
{
|
||||
if(dkl.dkl_map[i].dkl_cylno > 0 &&
|
||||
dkl.dkl_map[i].dkl_nblk > 0)
|
||||
{
|
||||
var part = new Partition
|
||||
{
|
||||
Size = (ulong)dkl.dkl_map[i].dkl_nblk * DK_LABEL_SIZE,
|
||||
Length = (ulong)(dkl.dkl_map[i].dkl_nblk * DK_LABEL_SIZE / imagePlugin.Info.SectorSize),
|
||||
Sequence = (ulong)i,
|
||||
Offset =
|
||||
((ulong)dkl.dkl_map[i].dkl_cylno * sectorsPerCylinder + sectorOffset) * DK_LABEL_SIZE,
|
||||
Start = ((ulong)dkl.dkl_map[i].dkl_cylno * sectorsPerCylinder + sectorOffset) *
|
||||
DK_LABEL_SIZE / imagePlugin.Info.SectorSize,
|
||||
Type = Localization.SunOS_partition,
|
||||
Scheme = Name
|
||||
};
|
||||
if(dkl.dkl_map[i].dkl_cylno <= 0 ||
|
||||
dkl.dkl_map[i].dkl_nblk <= 0)
|
||||
continue;
|
||||
|
||||
if(part.Start < imagePlugin.Info.Sectors &&
|
||||
part.End <= imagePlugin.Info.Sectors)
|
||||
partitions.Add(part);
|
||||
}
|
||||
var part = new Partition
|
||||
{
|
||||
Size = (ulong)dkl.dkl_map[i].dkl_nblk * DK_LABEL_SIZE,
|
||||
Length = (ulong)(dkl.dkl_map[i].dkl_nblk * DK_LABEL_SIZE / imagePlugin.Info.SectorSize),
|
||||
Sequence = (ulong)i,
|
||||
Offset =
|
||||
((ulong)dkl.dkl_map[i].dkl_cylno * sectorsPerCylinder + sectorOffset) * DK_LABEL_SIZE,
|
||||
Start = ((ulong)dkl.dkl_map[i].dkl_cylno * sectorsPerCylinder + sectorOffset) *
|
||||
DK_LABEL_SIZE / imagePlugin.Info.SectorSize,
|
||||
Type = Localization.SunOS_partition,
|
||||
Scheme = Name
|
||||
};
|
||||
|
||||
if(part.Start < imagePlugin.Info.Sectors &&
|
||||
part.End <= imagePlugin.Info.Sectors)
|
||||
partitions.Add(part);
|
||||
}
|
||||
}
|
||||
else if(useDkl8)
|
||||
@@ -271,35 +271,35 @@ public sealed class SunDisklabel : IPartition
|
||||
|
||||
for(var i = 0; i < dkl8.dkl_vtoc.v_nparts; i++)
|
||||
{
|
||||
if(dkl8.dkl_map[i].dkl_nblk > 0 &&
|
||||
dkl8.dkl_vtoc.v_part[i].p_tag != SunTag.SunEmpty &&
|
||||
dkl8.dkl_vtoc.v_part[i].p_tag != SunTag.SunWholeDisk)
|
||||
if(dkl8.dkl_map[i].dkl_nblk <= 0 ||
|
||||
dkl8.dkl_vtoc.v_part[i].p_tag == SunTag.SunEmpty ||
|
||||
dkl8.dkl_vtoc.v_part[i].p_tag == SunTag.SunWholeDisk)
|
||||
continue;
|
||||
|
||||
var part = new Partition
|
||||
{
|
||||
var part = new Partition
|
||||
{
|
||||
Description = SunFlagsToString(dkl8.dkl_vtoc.v_part[i].p_flag),
|
||||
Size = (ulong)dkl8.dkl_map[i].dkl_nblk * DK_LABEL_SIZE,
|
||||
Length = (ulong)(dkl8.dkl_map[i].dkl_nblk * DK_LABEL_SIZE / imagePlugin.Info.SectorSize),
|
||||
Sequence = (ulong)i,
|
||||
Offset = ((ulong)dkl8.dkl_map[i].dkl_cylno * sectorsPerCylinder + sectorOffset) *
|
||||
DK_LABEL_SIZE,
|
||||
Start = ((ulong)dkl8.dkl_map[i].dkl_cylno * sectorsPerCylinder + sectorOffset) *
|
||||
DK_LABEL_SIZE / imagePlugin.Info.SectorSize,
|
||||
Type = SunIdToString(dkl8.dkl_vtoc.v_part[i].p_tag),
|
||||
Scheme = Name
|
||||
};
|
||||
Description = SunFlagsToString(dkl8.dkl_vtoc.v_part[i].p_flag),
|
||||
Size = (ulong)dkl8.dkl_map[i].dkl_nblk * DK_LABEL_SIZE,
|
||||
Length = (ulong)(dkl8.dkl_map[i].dkl_nblk * DK_LABEL_SIZE / imagePlugin.Info.SectorSize),
|
||||
Sequence = (ulong)i,
|
||||
Offset = ((ulong)dkl8.dkl_map[i].dkl_cylno * sectorsPerCylinder + sectorOffset) *
|
||||
DK_LABEL_SIZE,
|
||||
Start = ((ulong)dkl8.dkl_map[i].dkl_cylno * sectorsPerCylinder + sectorOffset) *
|
||||
DK_LABEL_SIZE / imagePlugin.Info.SectorSize,
|
||||
Type = SunIdToString(dkl8.dkl_vtoc.v_part[i].p_tag),
|
||||
Scheme = Name
|
||||
};
|
||||
|
||||
if(dkl8.dkl_vtoc.v_timestamp[i] != 0)
|
||||
{
|
||||
part.Description += "\n" + string.Format(Localization.Partition_timestamped_on_0,
|
||||
DateHandlers.
|
||||
UnixToDateTime(dkl8.dkl_vtoc.v_timestamp[i]));
|
||||
}
|
||||
|
||||
if(part.Start < imagePlugin.Info.Sectors &&
|
||||
part.End <= imagePlugin.Info.Sectors)
|
||||
partitions.Add(part);
|
||||
if(dkl8.dkl_vtoc.v_timestamp[i] != 0)
|
||||
{
|
||||
part.Description += "\n" + string.Format(Localization.Partition_timestamped_on_0,
|
||||
DateHandlers.
|
||||
UnixToDateTime(dkl8.dkl_vtoc.v_timestamp[i]));
|
||||
}
|
||||
|
||||
if(part.Start < imagePlugin.Info.Sectors &&
|
||||
part.End <= imagePlugin.Info.Sectors)
|
||||
partitions.Add(part);
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -357,35 +357,35 @@ public sealed class SunDisklabel : IPartition
|
||||
|
||||
for(var i = 0; i < dkl16.dkl_vtoc.v_nparts; i++)
|
||||
{
|
||||
if(dkl16.dkl_vtoc.v_part[i].p_size > 0 &&
|
||||
dkl16.dkl_vtoc.v_part[i].p_tag != SunTag.SunEmpty &&
|
||||
dkl16.dkl_vtoc.v_part[i].p_tag != SunTag.SunWholeDisk)
|
||||
if(dkl16.dkl_vtoc.v_part[i].p_size <= 0 ||
|
||||
dkl16.dkl_vtoc.v_part[i].p_tag == SunTag.SunEmpty ||
|
||||
dkl16.dkl_vtoc.v_part[i].p_tag == SunTag.SunWholeDisk)
|
||||
continue;
|
||||
|
||||
var part = new Partition
|
||||
{
|
||||
var part = new Partition
|
||||
{
|
||||
Description = SunFlagsToString(dkl16.dkl_vtoc.v_part[i].p_flag),
|
||||
Size = (ulong)dkl16.dkl_vtoc.v_part[i].p_size * dkl16.dkl_vtoc.v_sectorsz,
|
||||
Length = (ulong)(dkl16.dkl_vtoc.v_part[i].p_size * dkl16.dkl_vtoc.v_sectorsz /
|
||||
imagePlugin.Info.SectorSize),
|
||||
Sequence = (ulong)i,
|
||||
Offset = ((ulong)dkl16.dkl_vtoc.v_part[i].p_start + sectorOffset) * dkl16.dkl_vtoc.v_sectorsz,
|
||||
Start = ((ulong)dkl16.dkl_vtoc.v_part[i].p_start + sectorOffset) * dkl16.dkl_vtoc.v_sectorsz /
|
||||
imagePlugin.Info.SectorSize,
|
||||
Type = SunIdToString(dkl16.dkl_vtoc.v_part[i].p_tag),
|
||||
Scheme = Name
|
||||
};
|
||||
Description = SunFlagsToString(dkl16.dkl_vtoc.v_part[i].p_flag),
|
||||
Size = (ulong)dkl16.dkl_vtoc.v_part[i].p_size * dkl16.dkl_vtoc.v_sectorsz,
|
||||
Length = (ulong)(dkl16.dkl_vtoc.v_part[i].p_size * dkl16.dkl_vtoc.v_sectorsz /
|
||||
imagePlugin.Info.SectorSize),
|
||||
Sequence = (ulong)i,
|
||||
Offset = ((ulong)dkl16.dkl_vtoc.v_part[i].p_start + sectorOffset) * dkl16.dkl_vtoc.v_sectorsz,
|
||||
Start = ((ulong)dkl16.dkl_vtoc.v_part[i].p_start + sectorOffset) * dkl16.dkl_vtoc.v_sectorsz /
|
||||
imagePlugin.Info.SectorSize,
|
||||
Type = SunIdToString(dkl16.dkl_vtoc.v_part[i].p_tag),
|
||||
Scheme = Name
|
||||
};
|
||||
|
||||
if(dkl16.dkl_vtoc.v_timestamp[i] != 0)
|
||||
{
|
||||
part.Description += "\n" + string.Format(Localization.Partition_timestamped_on_0,
|
||||
DateHandlers.
|
||||
UnixToDateTime(dkl16.dkl_vtoc.v_timestamp[i]));
|
||||
}
|
||||
|
||||
if(part.Start < imagePlugin.Info.Sectors &&
|
||||
part.End <= imagePlugin.Info.Sectors)
|
||||
partitions.Add(part);
|
||||
if(dkl16.dkl_vtoc.v_timestamp[i] != 0)
|
||||
{
|
||||
part.Description += "\n" + string.Format(Localization.Partition_timestamped_on_0,
|
||||
DateHandlers.
|
||||
UnixToDateTime(dkl16.dkl_vtoc.v_timestamp[i]));
|
||||
}
|
||||
|
||||
if(part.Start < imagePlugin.Info.Sectors &&
|
||||
part.End <= imagePlugin.Info.Sectors)
|
||||
partitions.Add(part);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -367,63 +367,63 @@ public sealed class VTOC : IPartition
|
||||
// This means partition starts are absolute, not relative, to the VTOC position
|
||||
for(var i = 0; i < V_NUMPAR; i++)
|
||||
{
|
||||
if(parts[i].p_tag == pTag.V_BACKUP &&
|
||||
(ulong)parts[i].p_start == sectorOffset)
|
||||
{
|
||||
absolute = true;
|
||||
if(parts[i].p_tag != pTag.V_BACKUP ||
|
||||
(ulong)parts[i].p_start != sectorOffset)
|
||||
continue;
|
||||
|
||||
break;
|
||||
}
|
||||
absolute = true;
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
for(var i = 0; i < V_NUMPAR; i++)
|
||||
{
|
||||
if(parts[i].p_tag != pTag.V_UNUSED)
|
||||
if(parts[i].p_tag == pTag.V_UNUSED)
|
||||
continue;
|
||||
|
||||
var part = new Partition
|
||||
{
|
||||
var part = new Partition
|
||||
{
|
||||
Start = (ulong)(parts[i].p_start * bps) / imagePlugin.Info.SectorSize,
|
||||
Length = (ulong)(parts[i].p_size * bps) / imagePlugin.Info.SectorSize,
|
||||
Offset = (ulong)(parts[i].p_start * bps),
|
||||
Size = (ulong)(parts[i].p_size * bps),
|
||||
Sequence = (ulong)i,
|
||||
Type = $"UNIX: {DecodeUnixtag(parts[i].p_tag, !useOld)}",
|
||||
Scheme = Name
|
||||
};
|
||||
Start = (ulong)(parts[i].p_start * bps) / imagePlugin.Info.SectorSize,
|
||||
Length = (ulong)(parts[i].p_size * bps) / imagePlugin.Info.SectorSize,
|
||||
Offset = (ulong)(parts[i].p_start * bps),
|
||||
Size = (ulong)(parts[i].p_size * bps),
|
||||
Sequence = (ulong)i,
|
||||
Type = $"UNIX: {DecodeUnixtag(parts[i].p_tag, !useOld)}",
|
||||
Scheme = Name
|
||||
};
|
||||
|
||||
var info = "";
|
||||
var info = "";
|
||||
|
||||
// Apparently old ones are absolute :?
|
||||
if(!useOld &&
|
||||
!absolute)
|
||||
{
|
||||
part.Start += sectorOffset;
|
||||
part.Offset += sectorOffset * imagePlugin.Info.SectorSize;
|
||||
}
|
||||
|
||||
if(parts[i].p_flag.HasFlag(pFlag.V_VALID))
|
||||
info += Localization.valid;
|
||||
|
||||
if(parts[i].p_flag.HasFlag(pFlag.V_UNMNT))
|
||||
info += Localization._unmountable_;
|
||||
|
||||
if(parts[i].p_flag.HasFlag(pFlag.V_OPEN))
|
||||
info += Localization.open;
|
||||
|
||||
if(parts[i].p_flag.HasFlag(pFlag.V_REMAP))
|
||||
info += Localization.alternate_sector_mapping;
|
||||
|
||||
if(parts[i].p_flag.HasFlag(pFlag.V_RONLY))
|
||||
info += Localization._read_only_;
|
||||
|
||||
if(timestamps[i] != 0)
|
||||
info += string.Format(Localization.created_on_0, DateHandlers.UnixToDateTime(timestamps[i]));
|
||||
|
||||
part.Description = "UNIX slice" + info + ".";
|
||||
|
||||
if(part.End < imagePlugin.Info.Sectors)
|
||||
partitions.Add(part);
|
||||
// Apparently old ones are absolute :?
|
||||
if(!useOld &&
|
||||
!absolute)
|
||||
{
|
||||
part.Start += sectorOffset;
|
||||
part.Offset += sectorOffset * imagePlugin.Info.SectorSize;
|
||||
}
|
||||
|
||||
if(parts[i].p_flag.HasFlag(pFlag.V_VALID))
|
||||
info += Localization.valid;
|
||||
|
||||
if(parts[i].p_flag.HasFlag(pFlag.V_UNMNT))
|
||||
info += Localization._unmountable_;
|
||||
|
||||
if(parts[i].p_flag.HasFlag(pFlag.V_OPEN))
|
||||
info += Localization.open;
|
||||
|
||||
if(parts[i].p_flag.HasFlag(pFlag.V_REMAP))
|
||||
info += Localization.alternate_sector_mapping;
|
||||
|
||||
if(parts[i].p_flag.HasFlag(pFlag.V_RONLY))
|
||||
info += Localization._read_only_;
|
||||
|
||||
if(timestamps[i] != 0)
|
||||
info += string.Format(Localization.created_on_0, DateHandlers.UnixToDateTime(timestamps[i]));
|
||||
|
||||
part.Description = "UNIX slice" + info + ".";
|
||||
|
||||
if(part.End < imagePlugin.Info.Sectors)
|
||||
partitions.Add(part);
|
||||
}
|
||||
|
||||
return partitions.Count > 0;
|
||||
@@ -440,15 +440,15 @@ public sealed class VTOC : IPartition
|
||||
pTag.V_USER => "/usr",
|
||||
pTag.V_BACKUP => Localization.Whole_disk,
|
||||
pTag.V_STAND_OLD => isNew
|
||||
? "Stand"
|
||||
: Localization.Alternate_sector_space,
|
||||
? "Stand"
|
||||
: Localization.Alternate_sector_space,
|
||||
pTag.V_VAR_OLD => isNew ? "/var" : Localization.non_UNIX,
|
||||
pTag.V_HOME_OLD => isNew
|
||||
? "/home"
|
||||
: Localization.Alternate_track_space,
|
||||
? "/home"
|
||||
: Localization.Alternate_track_space,
|
||||
pTag.V_ALTSCTR_OLD => isNew
|
||||
? Localization.Alternate_sector_track
|
||||
: "Stand",
|
||||
? Localization.Alternate_sector_track
|
||||
: "Stand",
|
||||
pTag.V_CACHE => isNew ? Localization.Cache : "/var",
|
||||
pTag.V_RESERVED =>
|
||||
isNew ? Localization.Reserved : "/home",
|
||||
|
||||
@@ -81,24 +81,24 @@ public abstract class FsExtractIssueTest
|
||||
{
|
||||
foreach(string pluginName in idPlugins)
|
||||
{
|
||||
if(plugins.ReadOnlyFilesystems.TryGetValue(pluginName, out pluginType))
|
||||
{
|
||||
Assert.IsNotNull(pluginType, Localization.Could_not_instantiate_filesystem_plugin);
|
||||
if(!plugins.ReadOnlyFilesystems.TryGetValue(pluginName, out pluginType))
|
||||
continue;
|
||||
|
||||
var fs = Activator.CreateInstance(pluginType) as IReadOnlyFilesystem;
|
||||
Assert.IsNotNull(pluginType, Localization.Could_not_instantiate_filesystem_plugin);
|
||||
|
||||
Assert.IsNotNull(fs,
|
||||
string.Format(Localization.Could_not_instantiate_filesystem_0, pluginName));
|
||||
var fs = Activator.CreateInstance(pluginType) as IReadOnlyFilesystem;
|
||||
|
||||
filesystemFound = true;
|
||||
Assert.IsNotNull(fs,
|
||||
string.Format(Localization.Could_not_instantiate_filesystem_0, pluginName));
|
||||
|
||||
error = fs.Mount(imageFormat, partitions[i], encodingClass, options, Namespace);
|
||||
filesystemFound = true;
|
||||
|
||||
Assert.AreEqual(ErrorNumber.NoError, error,
|
||||
string.Format(Localization.Could_not_mount_0_in_partition_1, pluginName, i));
|
||||
error = fs.Mount(imageFormat, partitions[i], encodingClass, options, Namespace);
|
||||
|
||||
ExtractFilesInDir("/", fs, Xattrs);
|
||||
}
|
||||
Assert.AreEqual(ErrorNumber.NoError, error,
|
||||
string.Format(Localization.Could_not_mount_0_in_partition_1, pluginName, i));
|
||||
|
||||
ExtractFilesInDir("/", fs, Xattrs);
|
||||
}
|
||||
}
|
||||
else
|
||||
|
||||
@@ -630,6 +630,9 @@
|
||||
<s:String x:Key="/Default/CustomTools/CustomToolsData/@EntryValue"></s:String>
|
||||
<s:String x:Key="/Default/Environment/Hierarchy/Build/BuildTool/CustomBuildToolPath/@EntryValue">/opt/dotnet/sdk/3.0.100/MSBuild.dll</s:String>
|
||||
<s:Int64 x:Key="/Default/Environment/Hierarchy/Build/BuildTool/MsbuildVersion/@EntryValue">1048576</s:Int64>
|
||||
<s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EFeature_002EServices_002ECpp_002ECodeStyle_002EIncludesOrder_002ECppIncludeDirectiveSettingsMigration/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EFeature_002EServices_002ECpp_002ECodeStyle_002ESettingsUpgrade_002EFunctionReturnStyleSettingsUpgrader/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EFeature_002EServices_002ECpp_002ECodeStyle_002ESettingsUpgrade_002ESpaceAroundPtrSettingsUpgrader/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002ECSharp_002ECodeStyle_002ECSharpKeepExistingMigration/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002ECSharp_002ECodeStyle_002ECSharpPlaceEmbeddedOnSameLineMigration/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002ECSharp_002ECodeStyle_002ECSharpUseContinuousIndentInsideBracesMigration/@EntryIndexedValue">True</s:Boolean>
|
||||
|
||||
@@ -314,37 +314,37 @@ sealed class ExtractFilesCommand : Command
|
||||
|
||||
foreach(string pluginName in idPlugins)
|
||||
{
|
||||
if(plugins.ReadOnlyFilesystems.TryGetValue(pluginName, out pluginType))
|
||||
if(!plugins.ReadOnlyFilesystems.TryGetValue(pluginName, out pluginType))
|
||||
continue;
|
||||
|
||||
AaruConsole.WriteLine($"[bold]{string.Format(UI.As_identified_by_0, pluginType.Name)
|
||||
}[/]");
|
||||
|
||||
if(Activator.CreateInstance(pluginType) is not IReadOnlyFilesystem fs)
|
||||
continue;
|
||||
|
||||
Core.Spectre.ProgressSingleSpinner(ctx =>
|
||||
{
|
||||
AaruConsole.WriteLine($"[bold]{string.Format(UI.As_identified_by_0, pluginType.Name)
|
||||
}[/]");
|
||||
ctx.AddTask(UI.Mounting_filesystem).
|
||||
IsIndeterminate();
|
||||
|
||||
if(Activator.CreateInstance(pluginType) is not IReadOnlyFilesystem fs)
|
||||
continue;
|
||||
error = fs.Mount(imageFormat, partitions[i],
|
||||
encodingClass, parsedOptions,
|
||||
@namespace);
|
||||
});
|
||||
|
||||
Core.Spectre.ProgressSingleSpinner(ctx =>
|
||||
{
|
||||
ctx.AddTask(UI.Mounting_filesystem).
|
||||
IsIndeterminate();
|
||||
if(error == ErrorNumber.NoError)
|
||||
{
|
||||
string volumeName = string.IsNullOrEmpty(fs.Metadata.VolumeName)
|
||||
? "NO NAME"
|
||||
: fs.Metadata.VolumeName;
|
||||
|
||||
error = fs.Mount(imageFormat, partitions[i],
|
||||
encodingClass, parsedOptions,
|
||||
@namespace);
|
||||
});
|
||||
ExtractFilesInDir("/", fs, volumeName, outputDir, xattrs);
|
||||
|
||||
if(error == ErrorNumber.NoError)
|
||||
{
|
||||
string volumeName = string.IsNullOrEmpty(fs.Metadata.VolumeName)
|
||||
? "NO NAME"
|
||||
: fs.Metadata.VolumeName;
|
||||
|
||||
ExtractFilesInDir("/", fs, volumeName, outputDir, xattrs);
|
||||
|
||||
Statistics.AddFilesystem(fs.Metadata.Type);
|
||||
}
|
||||
else
|
||||
AaruConsole.ErrorWriteLine(UI.Unable_to_mount_volume_error_0, error.ToString());
|
||||
Statistics.AddFilesystem(fs.Metadata.Type);
|
||||
}
|
||||
else
|
||||
AaruConsole.ErrorWriteLine(UI.Unable_to_mount_volume_error_0, error.ToString());
|
||||
}
|
||||
}
|
||||
else
|
||||
|
||||
@@ -304,20 +304,19 @@ sealed class FilesystemInfoCommand : Command
|
||||
|
||||
foreach(string pluginName in idPlugins)
|
||||
{
|
||||
if(plugins.Filesystems.TryGetValue(pluginName, out pluginType))
|
||||
{
|
||||
if(Activator.CreateInstance(pluginType) is not IFilesystem fs)
|
||||
continue;
|
||||
if(!plugins.Filesystems.TryGetValue(pluginName, out pluginType))
|
||||
continue;
|
||||
if(Activator.CreateInstance(pluginType) is not IFilesystem fs)
|
||||
continue;
|
||||
|
||||
AaruConsole.WriteLine($"[bold]{string.Format(UI.As_identified_by_0, fs.Name)
|
||||
}[/]");
|
||||
AaruConsole.WriteLine($"[bold]{string.Format(UI.As_identified_by_0, fs.Name)
|
||||
}[/]");
|
||||
|
||||
fs.GetInformation(imageFormat, partitionsList[i], encodingClass,
|
||||
out information, out FileSystem fsMetadata);
|
||||
fs.GetInformation(imageFormat, partitionsList[i], encodingClass,
|
||||
out information, out FileSystem fsMetadata);
|
||||
|
||||
AaruConsole.Write(information);
|
||||
Statistics.AddFilesystem(fsMetadata.Type);
|
||||
}
|
||||
AaruConsole.Write(information);
|
||||
Statistics.AddFilesystem(fsMetadata.Type);
|
||||
}
|
||||
|
||||
break;
|
||||
@@ -375,19 +374,18 @@ sealed class FilesystemInfoCommand : Command
|
||||
|
||||
foreach(string pluginName in idPlugins)
|
||||
{
|
||||
if(plugins.Filesystems.TryGetValue(pluginName, out pluginType))
|
||||
{
|
||||
if(Activator.CreateInstance(pluginType) is not IFilesystem fs)
|
||||
continue;
|
||||
if(!plugins.Filesystems.TryGetValue(pluginName, out pluginType))
|
||||
continue;
|
||||
if(Activator.CreateInstance(pluginType) is not IFilesystem fs)
|
||||
continue;
|
||||
|
||||
AaruConsole.WriteLine($"[bold]{string.Format(UI.As_identified_by_0, fs.Name)}[/]");
|
||||
AaruConsole.WriteLine($"[bold]{string.Format(UI.As_identified_by_0, fs.Name)}[/]");
|
||||
|
||||
fs.GetInformation(imageFormat, wholePart, encodingClass, out information,
|
||||
out FileSystem fsMetadata);
|
||||
fs.GetInformation(imageFormat, wholePart, encodingClass, out information,
|
||||
out FileSystem fsMetadata);
|
||||
|
||||
AaruConsole.Write(information);
|
||||
Statistics.AddFilesystem(fsMetadata.Type);
|
||||
}
|
||||
AaruConsole.Write(information);
|
||||
Statistics.AddFilesystem(fsMetadata.Type);
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
@@ -286,32 +286,31 @@ sealed class LsCommand : Command
|
||||
|
||||
foreach(string pluginName in idPlugins)
|
||||
{
|
||||
if(plugins.ReadOnlyFilesystems.TryGetValue(pluginName, out pluginType))
|
||||
if(!plugins.ReadOnlyFilesystems.TryGetValue(pluginName, out pluginType))
|
||||
continue;
|
||||
if(Activator.CreateInstance(pluginType) is not IReadOnlyFilesystem fs)
|
||||
continue;
|
||||
|
||||
AaruConsole.WriteLine($"[bold]{string.Format(UI.As_identified_by_0, fs.Name)}[/]");
|
||||
|
||||
Core.Spectre.ProgressSingleSpinner(ctx =>
|
||||
{
|
||||
if(Activator.CreateInstance(pluginType) is not IReadOnlyFilesystem fs)
|
||||
continue;
|
||||
ctx.AddTask(UI.Mounting_filesystem).
|
||||
IsIndeterminate();
|
||||
|
||||
AaruConsole.WriteLine($"[bold]{string.Format(UI.As_identified_by_0, fs.Name)}[/]");
|
||||
error = fs.Mount(imageFormat, partitions[i],
|
||||
encodingClass, parsedOptions,
|
||||
@namespace);
|
||||
});
|
||||
|
||||
Core.Spectre.ProgressSingleSpinner(ctx =>
|
||||
{
|
||||
ctx.AddTask(UI.Mounting_filesystem).
|
||||
IsIndeterminate();
|
||||
if(error == ErrorNumber.NoError)
|
||||
{
|
||||
ListFilesInDir("/", fs, longFormat);
|
||||
|
||||
error = fs.Mount(imageFormat, partitions[i],
|
||||
encodingClass, parsedOptions,
|
||||
@namespace);
|
||||
});
|
||||
|
||||
if(error == ErrorNumber.NoError)
|
||||
{
|
||||
ListFilesInDir("/", fs, longFormat);
|
||||
|
||||
Statistics.AddFilesystem(fs.Metadata.Type);
|
||||
}
|
||||
else
|
||||
AaruConsole.ErrorWriteLine(UI.Unable_to_mount_volume_error_0, error.ToString());
|
||||
Statistics.AddFilesystem(fs.Metadata.Type);
|
||||
}
|
||||
else
|
||||
AaruConsole.ErrorWriteLine(UI.Unable_to_mount_volume_error_0, error.ToString());
|
||||
}
|
||||
}
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user