diff --git a/Filters.cs b/Filters.cs index 38c7d2a0a..3cff3ceb3 100644 --- a/Filters.cs +++ b/Filters.cs @@ -42,6 +42,7 @@ using System.IO; using System.Linq; using System.Reflection; using Aaru.CommonTypes.Interfaces; +using Aaru.CommonTypes.Structs; using Aaru.Console; namespace Aaru.CommonTypes @@ -93,9 +94,7 @@ namespace Aaru.CommonTypes var foundFilter = (IFilter)filter.GetType().GetConstructor(Type.EmptyTypes)?.Invoke(new object[] {}); - foundFilter?.Open(path); - - if(foundFilter.Opened) + if(foundFilter?.Open(path) == Errno.NoError) return foundFilter; } else diff --git a/Interfaces/IFilter.cs b/Interfaces/IFilter.cs index cb5bd6c87..eb6d86305 100644 --- a/Interfaces/IFilter.cs +++ b/Interfaces/IFilter.cs @@ -38,6 +38,7 @@ using System; using System.IO; +using Aaru.CommonTypes.Structs; namespace Aaru.CommonTypes.Interfaces { @@ -108,12 +109,6 @@ namespace Aaru.CommonTypes.Interfaces /// Returns true if the file referenced by this filter has a resource fork bool HasResourceFork { get; } - /// - /// Returns true if the filter has a file/stream/buffer currently opened and no - /// has been issued. - /// - bool Opened { get; } - /// Closes all opened streams. void Close(); @@ -139,14 +134,14 @@ namespace Aaru.CommonTypes.Interfaces /// Opens the specified path with this filter instance /// Path. - void Open(string path); + Errno Open(string path); /// Opens the specified stream with this filter instance /// Stream. - void Open(Stream stream); + Errno Open(Stream stream); /// Opens the specified buffer with this filter instance /// Buffer. - void Open(byte[] buffer); + Errno Open(byte[] buffer); } } \ No newline at end of file