🎨🎨🎨 Removed methods in images that only returned what's already in the ImageInfo structure.

This commit is contained in:
2017-12-26 02:51:10 +00:00
parent 03a4e286cc
commit a002253fa4
135 changed files with 2111 additions and 8526 deletions

View File

@@ -106,12 +106,12 @@ namespace DiscImageChef.Commands
DicConsole.DebugWriteLine("Analyze command", "Correctly opened image file.");
DicConsole.DebugWriteLine("Analyze command", "Image without headers is {0} bytes.",
imageFormat.GetImageSize());
DicConsole.DebugWriteLine("Analyze command", "Image has {0} sectors.", imageFormat.GetSectors());
imageFormat.ImageInfo.ImageSize);
DicConsole.DebugWriteLine("Analyze command", "Image has {0} sectors.", imageFormat.ImageInfo.Sectors);
DicConsole.DebugWriteLine("Analyze command", "Image identifies disk type as {0}.",
imageFormat.GetMediaType());
imageFormat.ImageInfo.MediaType);
Core.Statistics.AddMediaFormat(imageFormat.GetImageFormat());
Core.Statistics.AddMediaFormat(imageFormat.ImageFormat);
Core.Statistics.AddMedia(imageFormat.ImageInfo.MediaType, false);
Core.Statistics.AddFilter(inputFilter.Name);
}
@@ -198,8 +198,8 @@ namespace DiscImageChef.Commands
Partition wholePart = new Partition
{
Name = "Whole device",
Length = imageFormat.GetSectors(),
Size = imageFormat.GetSectors() * imageFormat.GetSectorSize()
Length = imageFormat.ImageInfo.Sectors,
Size = imageFormat.ImageInfo.Sectors * imageFormat.ImageInfo.SectorSize
};
Core.Filesystems.Identify(imageFormat, out idPlugins, wholePart);

View File

@@ -82,7 +82,7 @@ namespace DiscImageChef.Commands
}
inputFormat.OpenImage(inputFilter);
Core.Statistics.AddMediaFormat(inputFormat.GetImageFormat());
Core.Statistics.AddMediaFormat(inputFormat.ImageFormat);
Core.Statistics.AddMedia(inputFormat.ImageInfo.MediaType, false);
Core.Statistics.AddFilter(inputFilter.Name);
EnableChecksum enabledChecksums = new EnableChecksum();
@@ -101,7 +101,7 @@ namespace DiscImageChef.Commands
Core.Checksum mediaChecksum = null;
if(inputFormat.ImageInfo.ImageHasPartitions)
if(inputFormat.ImageInfo.HasPartitions)
try
{
Core.Checksum trackChecksum = null;
@@ -110,7 +110,7 @@ namespace DiscImageChef.Commands
ulong previousTrackEnd = 0;
List<Track> inputTracks = inputFormat.GetTracks();
List<Track> inputTracks = inputFormat.Tracks;
foreach(Track currentTrack in inputTracks)
{
if(currentTrack.TrackStartSector - previousTrackEnd != 0 && options.WholeDisc)
@@ -171,8 +171,8 @@ namespace DiscImageChef.Commands
previousTrackEnd = currentTrack.TrackEndSector;
}
if(inputFormat.GetSectors() - previousTrackEnd != 0 && options.WholeDisc)
for(ulong i = previousTrackEnd + 1; i < inputFormat.GetSectors(); i++)
if(inputFormat.ImageInfo.Sectors - previousTrackEnd != 0 && options.WholeDisc)
for(ulong i = previousTrackEnd + 1; i < inputFormat.ImageInfo.Sectors; i++)
{
DicConsole.Write("\rHashing track-less sector {0}", i);
@@ -194,7 +194,7 @@ namespace DiscImageChef.Commands
{
mediaChecksum = new Core.Checksum(enabledChecksums);
ulong sectors = inputFormat.GetSectors();
ulong sectors = inputFormat.ImageInfo.Sectors;
DicConsole.WriteLine("Sectors {0}", sectors);
ulong doneSectors = 0;

View File

@@ -94,8 +94,8 @@ namespace DiscImageChef.Commands
input1Format.OpenImage(inputFilter1);
input2Format.OpenImage(inputFilter2);
Core.Statistics.AddMediaFormat(input1Format.GetImageFormat());
Core.Statistics.AddMediaFormat(input2Format.GetImageFormat());
Core.Statistics.AddMediaFormat(input1Format.ImageFormat);
Core.Statistics.AddMediaFormat(input2Format.ImageFormat);
Core.Statistics.AddMedia(input1Format.ImageInfo.MediaType, false);
Core.Statistics.AddMedia(input2Format.ImageInfo.MediaType, false);
Core.Statistics.AddFilter(inputFilter1.Name);
@@ -125,55 +125,38 @@ namespace DiscImageChef.Commands
Dictionary<MediaTagType, byte[]> image1DiskTags = new Dictionary<MediaTagType, byte[]>();
Dictionary<MediaTagType, byte[]> image2DiskTags = new Dictionary<MediaTagType, byte[]>();
image1Info.ImageHasPartitions = input1Format.ImageHasPartitions();
image1Info.HasPartitions = input1Format.ImageInfo.HasPartitions;
#pragma warning disable RECS0022 // A catch clause that catches System.Exception and has an empty body
try { image1Sessions = input1Format.GetSessions(); }
try { image1Sessions = input1Format.Sessions; }
catch
{
// ignored
}
#pragma warning restore RECS0022 // A catch clause that catches System.Exception and has an empty body
image1Info.ImageHasSessions |= image1Sessions.Count > 0;
image1Info.ImageSize = input1Format.GetImageSize();
image1Info.Sectors = input1Format.GetSectors();
image1Info.SectorSize = input1Format.GetSectorSize();
image1Info.ImageCreationTime = input1Format.GetImageCreationTime();
image1Info.ImageLastModificationTime = input1Format.GetImageLastModificationTime();
image1Info.MediaType = input1Format.GetMediaType();
try { image1Info.ImageVersion = input1Format.GetImageVersion(); }
catch { image1Info.ImageVersion = null; }
try { image1Info.ImageApplication = input1Format.GetImageApplication(); }
catch { image1Info.ImageApplication = null; }
try { image1Info.ImageApplicationVersion = input1Format.GetImageApplicationVersion(); }
catch { image1Info.ImageApplicationVersion = null; }
try { image1Info.ImageCreator = input1Format.GetImageCreator(); }
catch { image1Info.ImageCreator = null; }
try { image1Info.ImageName = input1Format.GetImageName(); }
catch { image1Info.ImageName = null; }
try { image1Info.ImageComments = input1Format.GetImageComments(); }
catch { image1Info.ImageComments = null; }
try { image1Info.MediaManufacturer = input1Format.GetMediaManufacturer(); }
catch { image1Info.MediaManufacturer = null; }
try { image1Info.MediaModel = input1Format.GetMediaModel(); }
catch { image1Info.MediaModel = null; }
try { image1Info.MediaSerialNumber = input1Format.GetMediaSerialNumber(); }
catch { image1Info.MediaSerialNumber = null; }
try { image1Info.MediaBarcode = input1Format.GetMediaBarcode(); }
catch { image1Info.MediaBarcode = null; }
try { image1Info.MediaPartNumber = input1Format.GetMediaPartNumber(); }
catch { image1Info.MediaPartNumber = null; }
try { image1Info.MediaSequence = input1Format.GetMediaSequence(); }
catch { image1Info.MediaSequence = 0; }
try { image1Info.LastMediaSequence = input1Format.GetLastDiskSequence(); }
catch { image1Info.LastMediaSequence = 0; }
try { image1Info.DriveManufacturer = input1Format.GetDriveManufacturer(); }
catch { image1Info.DriveManufacturer = null; }
try { image1Info.DriveModel = input1Format.GetDriveModel(); }
catch { image1Info.DriveModel = null; }
try { image1Info.DriveSerialNumber = input1Format.GetDriveSerialNumber(); }
catch { image1Info.DriveSerialNumber = null; }
try { image1Info.DriveFirmwareRevision = input1Format.ImageInfo.DriveFirmwareRevision; }
catch { image1Info.DriveFirmwareRevision = null; }
image1Info.HasSessions |= image1Sessions.Count > 0;
image1Info.ImageSize = input1Format.ImageInfo.ImageSize;
image1Info.Sectors = input1Format.ImageInfo.Sectors;
image1Info.SectorSize = input1Format.ImageInfo.SectorSize;
image1Info.CreationTime = input1Format.ImageInfo.CreationTime;
image1Info.LastModificationTime = input1Format.ImageInfo.LastModificationTime;
image1Info.MediaType = input1Format.ImageInfo.MediaType;
image1Info.Version = input1Format.ImageInfo.Version;
image1Info.Application = input1Format.ImageInfo.Application;
image1Info.ApplicationVersion = input1Format.ImageInfo.ApplicationVersion;
image1Info.Creator = input1Format.ImageInfo.Creator;
image1Info.MediaTitle = input1Format.ImageInfo.MediaTitle;
image1Info.Comments = input1Format.ImageInfo.Comments;
image1Info.MediaManufacturer = input1Format.ImageInfo.MediaManufacturer;
image1Info.MediaModel = input1Format.ImageInfo.MediaModel;
image1Info.MediaSerialNumber = input1Format.ImageInfo.MediaSerialNumber;
image1Info.MediaBarcode = input1Format.ImageInfo.MediaBarcode;
image1Info.MediaPartNumber = input1Format.ImageInfo.MediaPartNumber;
image1Info.MediaSequence = input1Format.ImageInfo.MediaSequence;
image1Info.LastMediaSequence = input1Format.ImageInfo.LastMediaSequence;
image1Info.DriveManufacturer = input1Format.ImageInfo.DriveManufacturer;
image1Info.DriveModel = input1Format.ImageInfo.DriveModel;
image1Info.DriveSerialNumber = input1Format.ImageInfo.DriveSerialNumber;
image1Info.DriveFirmwareRevision = input1Format.ImageInfo.DriveFirmwareRevision;
foreach(MediaTagType disktag in Enum.GetValues(typeof(MediaTagType)))
{
try
@@ -189,55 +172,38 @@ namespace DiscImageChef.Commands
#pragma warning restore RECS0022 // A catch clause that catches System.Exception and has an empty body
}
image2Info.ImageHasPartitions = input2Format.ImageHasPartitions();
image2Info.HasPartitions = input2Format.ImageInfo.HasPartitions;
#pragma warning disable RECS0022 // A catch clause that catches System.Exception and has an empty body
try { image2Sessions = input2Format.GetSessions(); }
try { image2Sessions = input2Format.Sessions; }
catch
{
// ignored
}
#pragma warning restore RECS0022 // A catch clause that catches System.Exception and has an empty body
image2Info.ImageHasSessions |= image2Sessions.Count > 0;
image2Info.ImageSize = input2Format.GetImageSize();
image2Info.Sectors = input2Format.GetSectors();
image2Info.SectorSize = input2Format.GetSectorSize();
image2Info.ImageCreationTime = input2Format.GetImageCreationTime();
image2Info.ImageLastModificationTime = input2Format.GetImageLastModificationTime();
image2Info.MediaType = input2Format.GetMediaType();
try { image2Info.ImageVersion = input2Format.GetImageVersion(); }
catch { image2Info.ImageVersion = null; }
try { image2Info.ImageApplication = input2Format.GetImageApplication(); }
catch { image2Info.ImageApplication = null; }
try { image2Info.ImageApplicationVersion = input2Format.GetImageApplicationVersion(); }
catch { image2Info.ImageApplicationVersion = null; }
try { image2Info.ImageCreator = input2Format.GetImageCreator(); }
catch { image2Info.ImageCreator = null; }
try { image2Info.ImageName = input2Format.GetImageName(); }
catch { image2Info.ImageName = null; }
try { image2Info.ImageComments = input2Format.GetImageComments(); }
catch { image2Info.ImageComments = null; }
try { image2Info.MediaManufacturer = input2Format.GetMediaManufacturer(); }
catch { image2Info.MediaManufacturer = null; }
try { image2Info.MediaModel = input2Format.GetMediaModel(); }
catch { image2Info.MediaModel = null; }
try { image2Info.MediaSerialNumber = input2Format.GetMediaSerialNumber(); }
catch { image2Info.MediaSerialNumber = null; }
try { image2Info.MediaBarcode = input2Format.GetMediaBarcode(); }
catch { image2Info.MediaBarcode = null; }
try { image2Info.MediaPartNumber = input2Format.GetMediaPartNumber(); }
catch { image2Info.MediaPartNumber = null; }
try { image2Info.MediaSequence = input2Format.GetMediaSequence(); }
catch { image2Info.MediaSequence = 0; }
try { image2Info.LastMediaSequence = input2Format.GetLastDiskSequence(); }
catch { image2Info.LastMediaSequence = 0; }
try { image2Info.DriveManufacturer = input2Format.GetDriveManufacturer(); }
catch { image2Info.DriveManufacturer = null; }
try { image2Info.DriveModel = input2Format.GetDriveModel(); }
catch { image2Info.DriveModel = null; }
try { image2Info.DriveSerialNumber = input2Format.GetDriveSerialNumber(); }
catch { image2Info.DriveSerialNumber = null; }
try { image2Info.DriveFirmwareRevision = input2Format.ImageInfo.DriveFirmwareRevision; }
catch { image2Info.DriveFirmwareRevision = null; }
image2Info.HasSessions |= image2Sessions.Count > 0;
image2Info.ImageSize = input2Format.ImageInfo.ImageSize;
image2Info.Sectors = input2Format.ImageInfo.Sectors;
image2Info.SectorSize = input2Format.ImageInfo.SectorSize;
image2Info.CreationTime = input2Format.ImageInfo.CreationTime;
image2Info.LastModificationTime = input2Format.ImageInfo.LastModificationTime;
image2Info.MediaType = input2Format.ImageInfo.MediaType;
image2Info.Version = input2Format.ImageInfo.Version;
image2Info.Application = input2Format.ImageInfo.Application;
image2Info.ApplicationVersion = input2Format.ImageInfo.ApplicationVersion;
image2Info.Creator = input2Format.ImageInfo.Creator;
image2Info.MediaTitle = input2Format.ImageInfo.MediaTitle;
image2Info.Comments = input2Format.ImageInfo.Comments;
image2Info.MediaManufacturer = input2Format.ImageInfo.MediaManufacturer;
image2Info.MediaModel = input2Format.ImageInfo.MediaModel;
image2Info.MediaSerialNumber = input2Format.ImageInfo.MediaSerialNumber;
image2Info.MediaBarcode = input2Format.ImageInfo.MediaBarcode;
image2Info.MediaPartNumber = input2Format.ImageInfo.MediaPartNumber;
image2Info.MediaSequence = input2Format.ImageInfo.MediaSequence;
image2Info.LastMediaSequence = input2Format.ImageInfo.LastMediaSequence;
image2Info.DriveManufacturer = input2Format.ImageInfo.DriveManufacturer;
image2Info.DriveModel = input2Format.ImageInfo.DriveModel;
image2Info.DriveSerialNumber = input2Format.ImageInfo.DriveSerialNumber;
image2Info.DriveFirmwareRevision = input2Format.ImageInfo.DriveFirmwareRevision;
foreach(MediaTagType disktag in Enum.GetValues(typeof(MediaTagType)))
{
try
@@ -255,28 +221,28 @@ namespace DiscImageChef.Commands
if(options.Verbose)
{
sb.AppendFormat("Has partitions?\t{0}\t{1}", image1Info.ImageHasPartitions,
image2Info.ImageHasPartitions).AppendLine();
sb.AppendFormat("Has sessions?\t{0}\t{1}", image1Info.ImageHasSessions, image2Info.ImageHasSessions)
sb.AppendFormat("Has partitions?\t{0}\t{1}", image1Info.HasPartitions,
image2Info.HasPartitions).AppendLine();
sb.AppendFormat("Has sessions?\t{0}\t{1}", image1Info.HasSessions, image2Info.HasSessions)
.AppendLine();
sb.AppendFormat("Image size\t{0}\t{1}", image1Info.ImageSize, image2Info.ImageSize).AppendLine();
sb.AppendFormat("Sectors\t{0}\t{1}", image1Info.Sectors, image2Info.Sectors).AppendLine();
sb.AppendFormat("Sector size\t{0}\t{1}", image1Info.SectorSize, image2Info.SectorSize).AppendLine();
sb.AppendFormat("Creation time\t{0}\t{1}", image1Info.ImageCreationTime, image2Info.ImageCreationTime)
sb.AppendFormat("Creation time\t{0}\t{1}", image1Info.CreationTime, image2Info.CreationTime)
.AppendLine();
sb.AppendFormat("Last modification time\t{0}\t{1}", image1Info.ImageLastModificationTime,
image2Info.ImageLastModificationTime).AppendLine();
sb.AppendFormat("Last modification time\t{0}\t{1}", image1Info.LastModificationTime,
image2Info.LastModificationTime).AppendLine();
sb.AppendFormat("Disk type\t{0}\t{1}", image1Info.MediaType, image2Info.MediaType).AppendLine();
sb.AppendFormat("Image version\t{0}\t{1}", image1Info.ImageVersion, image2Info.ImageVersion)
sb.AppendFormat("Image version\t{0}\t{1}", image1Info.Version, image2Info.Version)
.AppendLine();
sb.AppendFormat("Image application\t{0}\t{1}", image1Info.ImageApplication, image2Info.ImageApplication)
sb.AppendFormat("Image application\t{0}\t{1}", image1Info.Application, image2Info.Application)
.AppendLine();
sb.AppendFormat("Image application version\t{0}\t{1}", image1Info.ImageApplicationVersion,
image2Info.ImageApplicationVersion).AppendLine();
sb.AppendFormat("Image creator\t{0}\t{1}", image1Info.ImageCreator, image2Info.ImageCreator)
sb.AppendFormat("Image application version\t{0}\t{1}", image1Info.ApplicationVersion,
image2Info.ApplicationVersion).AppendLine();
sb.AppendFormat("Image creator\t{0}\t{1}", image1Info.Creator, image2Info.Creator)
.AppendLine();
sb.AppendFormat("Image name\t{0}\t{1}", image1Info.ImageName, image2Info.ImageName).AppendLine();
sb.AppendFormat("Image comments\t{0}\t{1}", image1Info.ImageComments, image2Info.ImageComments)
sb.AppendFormat("Image name\t{0}\t{1}", image1Info.MediaTitle, image2Info.MediaTitle).AppendLine();
sb.AppendFormat("Image comments\t{0}\t{1}", image1Info.Comments, image2Info.Comments)
.AppendLine();
sb.AppendFormat("Disk manufacturer\t{0}\t{1}", image1Info.MediaManufacturer,
image2Info.MediaManufacturer).AppendLine();
@@ -305,12 +271,12 @@ namespace DiscImageChef.Commands
DicConsole.WriteLine("Comparing disk image characteristics");
if(image1Info.ImageHasPartitions != image2Info.ImageHasPartitions)
if(image1Info.HasPartitions != image2Info.HasPartitions)
{
imagesDiffer = true;
if(!options.Verbose) sb.AppendLine("Image partitioned status differ");
}
if(image1Info.ImageHasSessions != image2Info.ImageHasSessions)
if(image1Info.HasSessions != image2Info.HasSessions)
{
imagesDiffer = true;
if(!options.Verbose) sb.AppendLine("Image session status differ");
@@ -330,12 +296,12 @@ namespace DiscImageChef.Commands
imagesDiffer = true;
if(!options.Verbose) sb.AppendLine("Image sector size differ");
}
if(image1Info.ImageCreationTime != image2Info.ImageCreationTime)
if(image1Info.CreationTime != image2Info.CreationTime)
{
imagesDiffer = true;
if(!options.Verbose) sb.AppendLine("Image creation time differ");
}
if(image1Info.ImageLastModificationTime != image2Info.ImageLastModificationTime)
if(image1Info.LastModificationTime != image2Info.LastModificationTime)
{
imagesDiffer = true;
if(!options.Verbose) sb.AppendLine("Image last modification time differ");
@@ -345,32 +311,32 @@ namespace DiscImageChef.Commands
imagesDiffer = true;
if(!options.Verbose) sb.AppendLine("Disk type differ");
}
if(image1Info.ImageVersion != image2Info.ImageVersion)
if(image1Info.Version != image2Info.Version)
{
imagesDiffer = true;
if(!options.Verbose) sb.AppendLine("Image version differ");
}
if(image1Info.ImageApplication != image2Info.ImageApplication)
if(image1Info.Application != image2Info.Application)
{
imagesDiffer = true;
if(!options.Verbose) sb.AppendLine("Image application differ");
}
if(image1Info.ImageApplicationVersion != image2Info.ImageApplicationVersion)
if(image1Info.ApplicationVersion != image2Info.ApplicationVersion)
{
imagesDiffer = true;
if(!options.Verbose) sb.AppendLine("Image application version differ");
}
if(image1Info.ImageCreator != image2Info.ImageCreator)
if(image1Info.Creator != image2Info.Creator)
{
imagesDiffer = true;
if(!options.Verbose) sb.AppendLine("Image creator differ");
}
if(image1Info.ImageName != image2Info.ImageName)
if(image1Info.MediaTitle != image2Info.MediaTitle)
{
imagesDiffer = true;
if(!options.Verbose) sb.AppendLine("Image name differ");
}
if(image1Info.ImageComments != image2Info.ImageComments)
if(image1Info.Comments != image2Info.Comments)
{
imagesDiffer = true;
if(!options.Verbose) sb.AppendLine("Image comments differ");

View File

@@ -120,7 +120,7 @@ namespace DiscImageChef.Commands
return;
}
Core.Statistics.AddMediaFormat(imageFormat.GetImageFormat());
Core.Statistics.AddMediaFormat(imageFormat.ImageFormat);
Core.Statistics.AddFilter(inputFilter.Name);
CICMMetadataType sidecar =

View File

@@ -71,7 +71,7 @@ namespace DiscImageChef.Commands
}
inputFormat.OpenImage(inputFilter);
Core.Statistics.AddMediaFormat(inputFormat.GetImageFormat());
Core.Statistics.AddMediaFormat(inputFormat.ImageFormat);
Core.Statistics.AddMedia(inputFormat.ImageInfo.MediaType, false);
Core.Statistics.AddFilter(inputFilter.Name);
@@ -232,7 +232,7 @@ namespace DiscImageChef.Commands
{
ulong length;
if(options.Length.ToLowerInvariant() == "all") length = inputFormat.GetSectors() - 1;
if(options.Length.ToLowerInvariant() == "all") length = inputFormat.ImageInfo.Sectors - 1;
else
{
if(!ulong.TryParse(options.Length, out length))

View File

@@ -70,7 +70,7 @@ namespace DiscImageChef.Commands
}
inputFormat.OpenImage(inputFilter);
Core.Statistics.AddMediaFormat(inputFormat.GetImageFormat());
Core.Statistics.AddMediaFormat(inputFormat.ImageFormat);
Core.Statistics.AddMedia(inputFormat.ImageInfo.MediaType, false);
Core.Statistics.AddFilter(inputFilter.Name);
double entropy = 0;
@@ -80,7 +80,7 @@ namespace DiscImageChef.Commands
if(options.SeparatedTracks)
try
{
List<Track> inputTracks = inputFormat.GetTracks();
List<Track> inputTracks = inputFormat.Tracks;
foreach(Track currentTrack in inputTracks)
{
@@ -134,7 +134,7 @@ namespace DiscImageChef.Commands
ulong diskSize = 0;
List<string> uniqueSectors = new List<string>();
sectors = inputFormat.GetSectors();
sectors = inputFormat.ImageInfo.Sectors;
DicConsole.WriteLine("Sectors {0}", sectors);
sha1Ctx.Init();

View File

@@ -114,13 +114,13 @@ namespace DiscImageChef.Commands
DicConsole.DebugWriteLine("Extract-Files command", "Correctly opened image file.");
DicConsole.DebugWriteLine("Extract-Files command", "Image without headers is {0} bytes.",
imageFormat.GetImageSize());
imageFormat.ImageInfo.ImageSize);
DicConsole.DebugWriteLine("Extract-Files command", "Image has {0} sectors.",
imageFormat.GetSectors());
imageFormat.ImageInfo.Sectors);
DicConsole.DebugWriteLine("Extract-Files command", "Image identifies disk type as {0}.",
imageFormat.GetMediaType());
imageFormat.ImageInfo.MediaType);
Core.Statistics.AddMediaFormat(imageFormat.GetImageFormat());
Core.Statistics.AddMediaFormat(imageFormat.ImageFormat);
Core.Statistics.AddMedia(imageFormat.ImageInfo.MediaType, false);
Core.Statistics.AddFilter(inputFilter.Name);
}
@@ -458,8 +458,8 @@ namespace DiscImageChef.Commands
Partition wholePart = new Partition
{
Name = "Whole device",
Length = imageFormat.GetSectors(),
Size = imageFormat.GetSectors() * imageFormat.GetSectorSize()
Length = imageFormat.ImageInfo.Sectors,
Size = imageFormat.ImageInfo.Sectors * imageFormat.ImageInfo.SectorSize
};
Core.Filesystems.Identify(imageFormat, out idPlugins, wholePart);

View File

@@ -102,12 +102,12 @@ namespace DiscImageChef.Commands
DicConsole.DebugWriteLine("Ls command", "Correctly opened image file.");
DicConsole.DebugWriteLine("Ls command", "Image without headers is {0} bytes.",
imageFormat.GetImageSize());
DicConsole.DebugWriteLine("Ls command", "Image has {0} sectors.", imageFormat.GetSectors());
imageFormat.ImageInfo.ImageSize);
DicConsole.DebugWriteLine("Ls command", "Image has {0} sectors.", imageFormat.ImageInfo.Sectors);
DicConsole.DebugWriteLine("Ls command", "Image identifies disk type as {0}.",
imageFormat.GetMediaType());
imageFormat.ImageInfo.MediaType);
Core.Statistics.AddMediaFormat(imageFormat.GetImageFormat());
Core.Statistics.AddMediaFormat(imageFormat.ImageFormat);
Core.Statistics.AddMedia(imageFormat.ImageInfo.MediaType, false);
Core.Statistics.AddFilter(inputFilter.Name);
}
@@ -205,8 +205,8 @@ namespace DiscImageChef.Commands
Partition wholePart = new Partition
{
Name = "Whole device",
Length = imageFormat.GetSectors(),
Size = imageFormat.GetSectors() * imageFormat.GetSectorSize()
Length = imageFormat.ImageInfo.Sectors,
Size = imageFormat.ImageInfo.Sectors * imageFormat.ImageInfo.SectorSize
};
Core.Filesystems.Identify(imageFormat, out idPlugins, wholePart);

View File

@@ -67,7 +67,7 @@ namespace DiscImageChef.Commands
}
inputFormat.OpenImage(inputFilter);
Core.Statistics.AddMediaFormat(inputFormat.GetImageFormat());
Core.Statistics.AddMediaFormat(inputFormat.ImageFormat);
Core.Statistics.AddMedia(inputFormat.ImageInfo.MediaType, false);
Core.Statistics.AddFilter(inputFilter.Name);
@@ -107,7 +107,7 @@ namespace DiscImageChef.Commands
bool formatHasTracks;
try
{
List<Track> inputTracks = inputFormat.GetTracks();
List<Track> inputTracks = inputFormat.Tracks;
formatHasTracks = inputTracks.Count > 0;
}
catch { formatHasTracks = false; }
@@ -120,7 +120,7 @@ namespace DiscImageChef.Commands
if(formatHasTracks)
{
List<Track> inputTracks = inputFormat.GetTracks();
List<Track> inputTracks = inputFormat.Tracks;
ulong currentSectorAll = 0;
startCheck = DateTime.UtcNow;
@@ -132,7 +132,7 @@ namespace DiscImageChef.Commands
while(remainingSectors > 0)
{
DicConsole.Write("\rChecking sector {0} of {1}, on track {2}", currentSectorAll,
inputFormat.GetSectors(), currentTrack.TrackSequence);
inputFormat.ImageInfo.Sectors, currentTrack.TrackSequence);
List<ulong> tempfailingLbas;
List<ulong> tempunknownLbas;
@@ -174,13 +174,13 @@ namespace DiscImageChef.Commands
}
else
{
ulong remainingSectors = inputFormat.GetSectors();
ulong remainingSectors = inputFormat.ImageInfo.Sectors;
ulong currentSector = 0;
startCheck = DateTime.UtcNow;
while(remainingSectors > 0)
{
DicConsole.Write("\rChecking sector {0} of {1}", currentSector, inputFormat.GetSectors());
DicConsole.Write("\rChecking sector {0} of {1}", currentSector, inputFormat.ImageInfo.Sectors);
List<ulong> tempfailingLbas;
List<ulong> tempunknownLbas;
@@ -239,22 +239,22 @@ namespace DiscImageChef.Commands
if(options.Verbose)
{
DicConsole.VerboseWriteLine("LBAs with error:");
if(failingLbas.Count == (int)inputFormat.GetSectors())
if(failingLbas.Count == (int)inputFormat.ImageInfo.Sectors)
DicConsole.VerboseWriteLine("\tall sectors.");
else foreach(ulong t in failingLbas) DicConsole.VerboseWriteLine("\t{0}", t);
DicConsole.WriteLine("LBAs without checksum:");
if(unknownLbas.Count == (int)inputFormat.GetSectors())
if(unknownLbas.Count == (int)inputFormat.ImageInfo.Sectors)
DicConsole.VerboseWriteLine("\tall sectors.");
else foreach(ulong t in unknownLbas) DicConsole.VerboseWriteLine("\t{0}", t);
}
DicConsole.WriteLine("Total sectors........... {0}", inputFormat.GetSectors());
DicConsole.WriteLine("Total sectors........... {0}", inputFormat.ImageInfo.Sectors);
DicConsole.WriteLine("Total errors............ {0}", failingLbas.Count);
DicConsole.WriteLine("Total unknowns.......... {0}", unknownLbas.Count);
DicConsole.WriteLine("Total errors+unknowns... {0}", failingLbas.Count + unknownLbas.Count);
totalSectors = (long)inputFormat.GetSectors();
totalSectors = (long)inputFormat.ImageInfo.Sectors;
errorSectors = failingLbas.Count;
unknownSectors = unknownLbas.Count;
correctSectors = totalSectors - errorSectors - unknownSectors;