General code refactor and reformat.

This commit is contained in:
2018-12-31 13:17:27 +00:00
parent 6b12cd1a8e
commit f2caa8c40f
413 changed files with 3554 additions and 6549 deletions

View File

@@ -74,10 +74,7 @@ namespace DiscImageChef.DiscImages
return true;
}
public byte[] ReadSector(ulong sectorAddress)
{
return ReadSectors(sectorAddress, 1);
}
public byte[] ReadSector(ulong sectorAddress) => ReadSectors(sectorAddress, 1);
public byte[] ReadSectors(ulong sectorAddress, uint length)
{

View File

@@ -39,80 +39,49 @@ namespace DiscImageChef.DiscImages
{
public partial class T98
{
public byte[] ReadDiskTag(MediaTagType tag)
{
public byte[] ReadDiskTag(MediaTagType tag) =>
throw new FeatureUnsupportedImageException("Feature not supported by image format");
}
public byte[] ReadSectorTag(ulong sectorAddress, SectorTagType tag)
{
public byte[] ReadSectorTag(ulong sectorAddress, SectorTagType tag) =>
throw new FeatureUnsupportedImageException("Feature not supported by image format");
}
public byte[] ReadSector(ulong sectorAddress, uint track)
{
public byte[] ReadSector(ulong sectorAddress, uint track) =>
throw new FeatureUnsupportedImageException("Feature not supported by image format");
}
public byte[] ReadSectorTag(ulong sectorAddress, uint track, SectorTagType tag)
{
public byte[] ReadSectorTag(ulong sectorAddress, uint track, SectorTagType tag) =>
throw new FeatureUnsupportedImageException("Feature not supported by image format");
}
public byte[] ReadSectorsTag(ulong sectorAddress, uint length, SectorTagType tag)
{
public byte[] ReadSectorsTag(ulong sectorAddress, uint length, SectorTagType tag) =>
throw new FeatureUnsupportedImageException("Feature not supported by image format");
}
public byte[] ReadSectors(ulong sectorAddress, uint length, uint track)
{
public byte[] ReadSectors(ulong sectorAddress, uint length, uint track) =>
throw new FeatureUnsupportedImageException("Feature not supported by image format");
}
public byte[] ReadSectorsTag(ulong sectorAddress, uint length, uint track, SectorTagType tag)
{
public byte[] ReadSectorsTag(ulong sectorAddress, uint length, uint track, SectorTagType tag) =>
throw new FeatureUnsupportedImageException("Feature not supported by image format");
}
public byte[] ReadSectorLong(ulong sectorAddress)
{
public byte[] ReadSectorLong(ulong sectorAddress) =>
throw new FeatureUnsupportedImageException("Feature not supported by image format");
}
public byte[] ReadSectorLong(ulong sectorAddress, uint track)
{
public byte[] ReadSectorLong(ulong sectorAddress, uint track) =>
throw new FeatureUnsupportedImageException("Feature not supported by image format");
}
public byte[] ReadSectorsLong(ulong sectorAddress, uint length)
{
public byte[] ReadSectorsLong(ulong sectorAddress, uint length) =>
throw new FeatureUnsupportedImageException("Feature not supported by image format");
}
public byte[] ReadSectorsLong(ulong sectorAddress, uint length, uint track)
{
public byte[] ReadSectorsLong(ulong sectorAddress, uint length, uint track) =>
throw new FeatureUnsupportedImageException("Feature not supported by image format");
}
public List<Track> GetSessionTracks(Session session)
{
public List<Track> GetSessionTracks(Session session) =>
throw new FeatureUnsupportedImageException("Feature not supported by image format");
}
public List<Track> GetSessionTracks(ushort session)
{
public List<Track> GetSessionTracks(ushort session) =>
throw new FeatureUnsupportedImageException("Feature not supported by image format");
}
public bool? VerifySector(ulong sectorAddress)
{
return null;
}
public bool? VerifySector(ulong sectorAddress) => null;
public bool? VerifySector(ulong sectorAddress, uint track)
{
public bool? VerifySector(ulong sectorAddress, uint track) =>
throw new FeatureUnsupportedImageException("Feature not supported by image format");
}
public bool? VerifySectors(ulong sectorAddress, uint length, out List<ulong> failingLbas,
out List<ulong> unknownLbas)
@@ -125,14 +94,9 @@ namespace DiscImageChef.DiscImages
}
public bool? VerifySectors(ulong sectorAddress, uint length, uint track, out List<ulong> failingLbas,
out List<ulong> unknownLbas)
{
out List<ulong> unknownLbas) =>
throw new FeatureUnsupportedImageException("Feature not supported by image format");
}
public bool? VerifyMediaImage()
{
return null;
}
public bool? VerifyMediaImage() => null;
}
}

View File

@@ -170,11 +170,7 @@ namespace DiscImageChef.DiscImages
return true;
}
public bool SetGeometry(uint cylinders, uint heads, uint sectorsPerTrack)
{
// Format uses fixed geometry for heads and sectors per track, cylinders must be calculated on closing.
return true;
}
public bool SetGeometry(uint cylinders, uint heads, uint sectorsPerTrack) => true;
public bool WriteSectorTag(byte[] data, ulong sectorAddress, SectorTagType tag)
{
@@ -188,21 +184,10 @@ namespace DiscImageChef.DiscImages
return false;
}
public bool SetDumpHardware(List<DumpHardwareType> dumpHardware)
{
// Not supported
return false;
}
public bool SetDumpHardware(List<DumpHardwareType> dumpHardware) => false;
public bool SetCicmMetadata(CICMMetadataType metadata)
{
// Not supported
return false;
}
public bool SetCicmMetadata(CICMMetadataType metadata) => false;
public bool SetMetadata(ImageInfo metadata)
{
return true;
}
public bool SetMetadata(ImageInfo metadata) => true;
}
}