mirror of
https://github.com/aaru-dps/Aaru.git
synced 2025-12-16 19:24:25 +00:00
🎨REFACTOR: Plugins do not need to expose their methods as virtual.
This commit is contained in:
@@ -50,10 +50,10 @@ namespace DiscImageChef.Filters
|
||||
DateTime lastWriteTime;
|
||||
bool opened;
|
||||
|
||||
public virtual string Name => "LZip";
|
||||
public virtual Guid Id => new Guid("09D715E9-20C0-48B1-A8D9-D8897CEC57C9");
|
||||
public string Name => "LZip";
|
||||
public Guid Id => new Guid("09D715E9-20C0-48B1-A8D9-D8897CEC57C9");
|
||||
|
||||
public virtual void Close()
|
||||
public void Close()
|
||||
{
|
||||
dataStream?.Close();
|
||||
dataStream = null;
|
||||
@@ -61,38 +61,38 @@ namespace DiscImageChef.Filters
|
||||
opened = false;
|
||||
}
|
||||
|
||||
public virtual string GetBasePath()
|
||||
public string GetBasePath()
|
||||
{
|
||||
return basePath;
|
||||
}
|
||||
|
||||
public virtual Stream GetDataForkStream()
|
||||
public Stream GetDataForkStream()
|
||||
{
|
||||
return innerStream;
|
||||
}
|
||||
|
||||
public virtual string GetPath()
|
||||
public string GetPath()
|
||||
{
|
||||
return basePath;
|
||||
}
|
||||
|
||||
public virtual Stream GetResourceForkStream()
|
||||
public Stream GetResourceForkStream()
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
public virtual bool HasResourceFork()
|
||||
public bool HasResourceFork()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
public virtual bool Identify(byte[] buffer)
|
||||
public bool Identify(byte[] buffer)
|
||||
{
|
||||
return buffer[0] == 0x4C && buffer[1] == 0x5A && buffer[2] == 0x49 && buffer[3] == 0x50 &&
|
||||
buffer[4] == 0x01;
|
||||
}
|
||||
|
||||
public virtual bool Identify(Stream stream)
|
||||
public bool Identify(Stream stream)
|
||||
{
|
||||
byte[] buffer = new byte[5];
|
||||
|
||||
@@ -104,7 +104,7 @@ namespace DiscImageChef.Filters
|
||||
buffer[4] == 0x01;
|
||||
}
|
||||
|
||||
public virtual bool Identify(string path)
|
||||
public bool Identify(string path)
|
||||
{
|
||||
if(!File.Exists(path)) return false;
|
||||
|
||||
@@ -119,7 +119,7 @@ namespace DiscImageChef.Filters
|
||||
buffer[4] == 0x01;
|
||||
}
|
||||
|
||||
public virtual void Open(byte[] buffer)
|
||||
public void Open(byte[] buffer)
|
||||
{
|
||||
dataStream = new MemoryStream(buffer);
|
||||
basePath = null;
|
||||
@@ -131,7 +131,7 @@ namespace DiscImageChef.Filters
|
||||
opened = true;
|
||||
}
|
||||
|
||||
public virtual void Open(Stream stream)
|
||||
public void Open(Stream stream)
|
||||
{
|
||||
dataStream = stream;
|
||||
basePath = null;
|
||||
@@ -147,7 +147,7 @@ namespace DiscImageChef.Filters
|
||||
opened = true;
|
||||
}
|
||||
|
||||
public virtual void Open(string path)
|
||||
public void Open(string path)
|
||||
{
|
||||
dataStream = new FileStream(path, FileMode.Open, FileAccess.Read);
|
||||
basePath = Path.GetFullPath(path);
|
||||
@@ -168,32 +168,32 @@ namespace DiscImageChef.Filters
|
||||
opened = true;
|
||||
}
|
||||
|
||||
public virtual DateTime GetCreationTime()
|
||||
public DateTime GetCreationTime()
|
||||
{
|
||||
return creationTime;
|
||||
}
|
||||
|
||||
public virtual long GetDataForkLength()
|
||||
public long GetDataForkLength()
|
||||
{
|
||||
return decompressedSize;
|
||||
}
|
||||
|
||||
public virtual DateTime GetLastWriteTime()
|
||||
public DateTime GetLastWriteTime()
|
||||
{
|
||||
return lastWriteTime;
|
||||
}
|
||||
|
||||
public virtual long GetLength()
|
||||
public long GetLength()
|
||||
{
|
||||
return decompressedSize;
|
||||
}
|
||||
|
||||
public virtual long GetResourceForkLength()
|
||||
public long GetResourceForkLength()
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
public virtual string GetFilename()
|
||||
public string GetFilename()
|
||||
{
|
||||
if(basePath?.EndsWith(".lz", StringComparison.InvariantCultureIgnoreCase) == true)
|
||||
return basePath.Substring(0, basePath.Length - 3);
|
||||
@@ -203,12 +203,12 @@ namespace DiscImageChef.Filters
|
||||
return basePath;
|
||||
}
|
||||
|
||||
public virtual string GetParentFolder()
|
||||
public string GetParentFolder()
|
||||
{
|
||||
return Path.GetDirectoryName(basePath);
|
||||
}
|
||||
|
||||
public virtual bool IsOpened()
|
||||
public bool IsOpened()
|
||||
{
|
||||
return opened;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user