🎨Converted all plugin types to interfaces.

This commit is contained in:
2017-12-26 06:05:12 +00:00
parent a002253fa4
commit f66a0bdd42
295 changed files with 9499 additions and 10414 deletions

View File

@@ -66,13 +66,13 @@ namespace DiscImageChef.Tests.Images
for(int i = 0; i < testfiles.Length; i++)
{
string location = Path.Combine(Consts.TestFilesRoot, "images", "2mg", testfiles[i]);
Filter filter = new LZip();
IFilter filter = new LZip();
filter.Open(location);
ImagePlugin image = new DiscImages.Apple2Mg();
IMediaImage image = new DiscImages.Apple2Mg();
Assert.AreEqual(true, image.OpenImage(filter), testfiles[i]);
Assert.AreEqual(sectors[i], image.ImageInfo.Sectors, testfiles[i]);
Assert.AreEqual(sectorsize[i], image.ImageInfo.SectorSize, testfiles[i]);
Assert.AreEqual(mediatypes[i], image.ImageInfo.MediaType, testfiles[i]);
Assert.AreEqual(sectors[i], image.Info.Sectors, testfiles[i]);
Assert.AreEqual(sectorsize[i], image.Info.SectorSize, testfiles[i]);
Assert.AreEqual(mediatypes[i], image.Info.MediaType, testfiles[i]);
// How many sectors to read at once
const uint SECTORS_TO_READ = 256;
@@ -81,19 +81,19 @@ namespace DiscImageChef.Tests.Images
Md5Context ctx = new Md5Context();
ctx.Init();
while(doneSectors < image.ImageInfo.Sectors)
while(doneSectors < image.Info.Sectors)
{
byte[] sector;
if(image.ImageInfo.Sectors - doneSectors >= SECTORS_TO_READ)
if(image.Info.Sectors - doneSectors >= SECTORS_TO_READ)
{
sector = image.ReadSectors(doneSectors, SECTORS_TO_READ);
doneSectors += SECTORS_TO_READ;
}
else
{
sector = image.ReadSectors(doneSectors, (uint)(image.ImageInfo.Sectors - doneSectors));
doneSectors += image.ImageInfo.Sectors - doneSectors;
sector = image.ReadSectors(doneSectors, (uint)(image.Info.Sectors - doneSectors));
doneSectors += image.Info.Sectors - doneSectors;
}
ctx.Update(sector);

View File

@@ -70,13 +70,13 @@ namespace DiscImageChef.Tests.Images
for(int i = 0; i < testfiles.Length; i++)
{
string location = Path.Combine(Consts.TestFilesRoot, "images", "anex86", testfiles[i]);
Filter filter = new LZip();
IFilter filter = new LZip();
filter.Open(location);
ImagePlugin image = new DiscImages.Anex86();
IMediaImage image = new DiscImages.Anex86();
Assert.AreEqual(true, image.OpenImage(filter), testfiles[i]);
Assert.AreEqual(sectors[i], image.ImageInfo.Sectors, testfiles[i]);
Assert.AreEqual(sectorsize[i], image.ImageInfo.SectorSize, testfiles[i]);
Assert.AreEqual(mediatypes[i], image.ImageInfo.MediaType, testfiles[i]);
Assert.AreEqual(sectors[i], image.Info.Sectors, testfiles[i]);
Assert.AreEqual(sectorsize[i], image.Info.SectorSize, testfiles[i]);
Assert.AreEqual(mediatypes[i], image.Info.MediaType, testfiles[i]);
// How many sectors to read at once
const uint SECTORS_TO_READ = 256;
@@ -85,19 +85,19 @@ namespace DiscImageChef.Tests.Images
Md5Context ctx = new Md5Context();
ctx.Init();
while(doneSectors < image.ImageInfo.Sectors)
while(doneSectors < image.Info.Sectors)
{
byte[] sector;
if(image.ImageInfo.Sectors - doneSectors >= SECTORS_TO_READ)
if(image.Info.Sectors - doneSectors >= SECTORS_TO_READ)
{
sector = image.ReadSectors(doneSectors, SECTORS_TO_READ);
doneSectors += SECTORS_TO_READ;
}
else
{
sector = image.ReadSectors(doneSectors, (uint)(image.ImageInfo.Sectors - doneSectors));
doneSectors += image.ImageInfo.Sectors - doneSectors;
sector = image.ReadSectors(doneSectors, (uint)(image.Info.Sectors - doneSectors));
doneSectors += image.Info.Sectors - doneSectors;
}
ctx.Update(sector);

View File

@@ -84,13 +84,13 @@ namespace DiscImageChef.Tests.Images
for(int i = 0; i < testfiles.Length; i++)
{
string location = Path.Combine(Consts.TestFilesRoot, "images", "ciscopy", testfiles[i]);
Filter filter = new LZip();
IFilter filter = new LZip();
filter.Open(location);
ImagePlugin image = new DiscImages.CisCopy();
IMediaImage image = new DiscImages.CisCopy();
Assert.AreEqual(true, image.OpenImage(filter), testfiles[i]);
Assert.AreEqual(sectors[i], image.ImageInfo.Sectors, testfiles[i]);
Assert.AreEqual(sectorsize[i], image.ImageInfo.SectorSize, testfiles[i]);
Assert.AreEqual(mediatypes[i], image.ImageInfo.MediaType, testfiles[i]);
Assert.AreEqual(sectors[i], image.Info.Sectors, testfiles[i]);
Assert.AreEqual(sectorsize[i], image.Info.SectorSize, testfiles[i]);
Assert.AreEqual(mediatypes[i], image.Info.MediaType, testfiles[i]);
// How many sectors to read at once
const uint SECTORS_TO_READ = 256;
@@ -99,19 +99,19 @@ namespace DiscImageChef.Tests.Images
Md5Context ctx = new Md5Context();
ctx.Init();
while(doneSectors < image.ImageInfo.Sectors)
while(doneSectors < image.Info.Sectors)
{
byte[] sector;
if(image.ImageInfo.Sectors - doneSectors >= SECTORS_TO_READ)
if(image.Info.Sectors - doneSectors >= SECTORS_TO_READ)
{
sector = image.ReadSectors(doneSectors, SECTORS_TO_READ);
doneSectors += SECTORS_TO_READ;
}
else
{
sector = image.ReadSectors(doneSectors, (uint)(image.ImageInfo.Sectors - doneSectors));
doneSectors += image.ImageInfo.Sectors - doneSectors;
sector = image.ReadSectors(doneSectors, (uint)(image.Info.Sectors - doneSectors));
doneSectors += image.Info.Sectors - doneSectors;
}
ctx.Update(sector);

View File

@@ -68,13 +68,13 @@ namespace DiscImageChef.Tests.Images
for(int i = 0; i < testfiles.Length; i++)
{
string location = Path.Combine(Consts.TestFilesRoot, "images", "copyqm", testfiles[i]);
Filter filter = new LZip();
IFilter filter = new LZip();
filter.Open(location);
ImagePlugin image = new DiscImages.CopyQm();
IMediaImage image = new DiscImages.CopyQm();
Assert.AreEqual(true, image.OpenImage(filter), testfiles[i]);
Assert.AreEqual(sectors[i], image.ImageInfo.Sectors, testfiles[i]);
Assert.AreEqual(sectorsize[i], image.ImageInfo.SectorSize, testfiles[i]);
Assert.AreEqual(mediatypes[i], image.ImageInfo.MediaType, testfiles[i]);
Assert.AreEqual(sectors[i], image.Info.Sectors, testfiles[i]);
Assert.AreEqual(sectorsize[i], image.Info.SectorSize, testfiles[i]);
Assert.AreEqual(mediatypes[i], image.Info.MediaType, testfiles[i]);
// How many sectors to read at once
const uint SECTORS_TO_READ = 256;
@@ -83,19 +83,19 @@ namespace DiscImageChef.Tests.Images
Md5Context ctx = new Md5Context();
ctx.Init();
while(doneSectors < image.ImageInfo.Sectors)
while(doneSectors < image.Info.Sectors)
{
byte[] sector;
if(image.ImageInfo.Sectors - doneSectors >= SECTORS_TO_READ)
if(image.Info.Sectors - doneSectors >= SECTORS_TO_READ)
{
sector = image.ReadSectors(doneSectors, SECTORS_TO_READ);
doneSectors += SECTORS_TO_READ;
}
else
{
sector = image.ReadSectors(doneSectors, (uint)(image.ImageInfo.Sectors - doneSectors));
doneSectors += image.ImageInfo.Sectors - doneSectors;
sector = image.ReadSectors(doneSectors, (uint)(image.Info.Sectors - doneSectors));
doneSectors += image.Info.Sectors - doneSectors;
}
ctx.Update(sector);

View File

@@ -86,13 +86,13 @@ namespace DiscImageChef.Tests.Images
for(int i = 0; i < testfiles.Length; i++)
{
string location = Path.Combine(Consts.TestFilesRoot, "images", "d88", testfiles[i]);
Filter filter = new LZip();
IFilter filter = new LZip();
filter.Open(location);
ImagePlugin image = new DiscImages.D88();
IMediaImage image = new DiscImages.D88();
Assert.AreEqual(true, image.OpenImage(filter), testfiles[i]);
Assert.AreEqual(sectors[i], image.ImageInfo.Sectors, testfiles[i]);
Assert.AreEqual(sectorsize[i], image.ImageInfo.SectorSize, testfiles[i]);
Assert.AreEqual(mediatypes[i], image.ImageInfo.MediaType, testfiles[i]);
Assert.AreEqual(sectors[i], image.Info.Sectors, testfiles[i]);
Assert.AreEqual(sectorsize[i], image.Info.SectorSize, testfiles[i]);
Assert.AreEqual(mediatypes[i], image.Info.MediaType, testfiles[i]);
// How many sectors to read at once
const uint SECTORS_TO_READ = 256;
@@ -101,19 +101,19 @@ namespace DiscImageChef.Tests.Images
Md5Context ctx = new Md5Context();
ctx.Init();
while(doneSectors < image.ImageInfo.Sectors)
while(doneSectors < image.Info.Sectors)
{
byte[] sector;
if(image.ImageInfo.Sectors - doneSectors >= SECTORS_TO_READ)
if(image.Info.Sectors - doneSectors >= SECTORS_TO_READ)
{
sector = image.ReadSectors(doneSectors, SECTORS_TO_READ);
doneSectors += SECTORS_TO_READ;
}
else
{
sector = image.ReadSectors(doneSectors, (uint)(image.ImageInfo.Sectors - doneSectors));
doneSectors += image.ImageInfo.Sectors - doneSectors;
sector = image.ReadSectors(doneSectors, (uint)(image.Info.Sectors - doneSectors));
doneSectors += image.Info.Sectors - doneSectors;
}
ctx.Update(sector);

View File

@@ -67,13 +67,13 @@ namespace DiscImageChef.Tests.Images
for(int i = 0; i < testfiles.Length; i++)
{
string location = Path.Combine(Consts.TestFilesRoot, "images", "dart", testfiles[i]);
Filter filter = new LZip();
IFilter filter = new LZip();
filter.Open(location);
ImagePlugin image = new DiscImages.D88();
IMediaImage image = new DiscImages.D88();
Assert.AreEqual(true, image.OpenImage(filter), testfiles[i]);
Assert.AreEqual(sectors[i], image.ImageInfo.Sectors, testfiles[i]);
Assert.AreEqual(sectorsize[i], image.ImageInfo.SectorSize, testfiles[i]);
Assert.AreEqual(mediatypes[i], image.ImageInfo.MediaType, testfiles[i]);
Assert.AreEqual(sectors[i], image.Info.Sectors, testfiles[i]);
Assert.AreEqual(sectorsize[i], image.Info.SectorSize, testfiles[i]);
Assert.AreEqual(mediatypes[i], image.Info.MediaType, testfiles[i]);
// How many sectors to read at once
const uint SECTORS_TO_READ = 256;
@@ -82,19 +82,19 @@ namespace DiscImageChef.Tests.Images
Md5Context ctx = new Md5Context();
ctx.Init();
while(doneSectors < image.ImageInfo.Sectors)
while(doneSectors < image.Info.Sectors)
{
byte[] sector;
if(image.ImageInfo.Sectors - doneSectors >= SECTORS_TO_READ)
if(image.Info.Sectors - doneSectors >= SECTORS_TO_READ)
{
sector = image.ReadSectors(doneSectors, SECTORS_TO_READ);
doneSectors += SECTORS_TO_READ;
}
else
{
sector = image.ReadSectors(doneSectors, (uint)(image.ImageInfo.Sectors - doneSectors));
doneSectors += image.ImageInfo.Sectors - doneSectors;
sector = image.ReadSectors(doneSectors, (uint)(image.Info.Sectors - doneSectors));
doneSectors += image.Info.Sectors - doneSectors;
}
ctx.Update(sector);

View File

@@ -87,13 +87,13 @@ namespace DiscImageChef.Tests.Images
for(int i = 0; i < testfiles.Length; i++)
{
string location = Path.Combine(Consts.TestFilesRoot, "images", "", testfiles[i]);
Filter filter = new LZip();
IFilter filter = new LZip();
filter.Open(location);
ImagePlugin image = new DiscImages.DiskCopy42();
IMediaImage image = new DiscImages.DiskCopy42();
Assert.AreEqual(true, image.OpenImage(filter), testfiles[i]);
Assert.AreEqual(sectors[i], image.ImageInfo.Sectors, testfiles[i]);
Assert.AreEqual(sectorsize[i], image.ImageInfo.SectorSize, testfiles[i]);
Assert.AreEqual(mediatypes[i], image.ImageInfo.MediaType, testfiles[i]);
Assert.AreEqual(sectors[i], image.Info.Sectors, testfiles[i]);
Assert.AreEqual(sectorsize[i], image.Info.SectorSize, testfiles[i]);
Assert.AreEqual(mediatypes[i], image.Info.MediaType, testfiles[i]);
// How many sectors to read at once
const uint SECTORS_TO_READ = 256;
@@ -102,19 +102,19 @@ namespace DiscImageChef.Tests.Images
Md5Context ctx = new Md5Context();
ctx.Init();
while(doneSectors < image.ImageInfo.Sectors)
while(doneSectors < image.Info.Sectors)
{
byte[] sector;
if(image.ImageInfo.Sectors - doneSectors >= SECTORS_TO_READ)
if(image.Info.Sectors - doneSectors >= SECTORS_TO_READ)
{
sector = image.ReadSectors(doneSectors, SECTORS_TO_READ);
doneSectors += SECTORS_TO_READ;
}
else
{
sector = image.ReadSectors(doneSectors, (uint)(image.ImageInfo.Sectors - doneSectors));
doneSectors += image.ImageInfo.Sectors - doneSectors;
sector = image.ReadSectors(doneSectors, (uint)(image.Info.Sectors - doneSectors));
doneSectors += image.Info.Sectors - doneSectors;
}
ctx.Update(sector);