mirror of
https://github.com/aaru-dps/Aaru.Server.git
synced 2025-12-16 19:24:27 +00:00
Refactor: Move filesystem identification code to Core.
This commit is contained in:
@@ -1,3 +1,8 @@
|
|||||||
|
2017-05-27 Natalia Portillo <claunia@claunia.com>
|
||||||
|
|
||||||
|
* DiscImageChef.Core.csproj: Refactor: Move filesystem
|
||||||
|
identification code to Core.
|
||||||
|
|
||||||
2017-05-27 Natalia Portillo <claunia@claunia.com>
|
2017-05-27 Natalia Portillo <claunia@claunia.com>
|
||||||
|
|
||||||
* DataFile.cs:
|
* DataFile.cs:
|
||||||
|
|||||||
@@ -50,6 +50,7 @@
|
|||||||
<Compile Include="Devices\Dumping\SCSI.cs" />
|
<Compile Include="Devices\Dumping\SCSI.cs" />
|
||||||
<Compile Include="Devices\Dumping\SecureDigital.cs" />
|
<Compile Include="Devices\Dumping\SecureDigital.cs" />
|
||||||
<Compile Include="DataFile.cs" />
|
<Compile Include="DataFile.cs" />
|
||||||
|
<Compile Include="Filesystems.cs" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ProjectReference Include="..\DiscImageChef.Console\DiscImageChef.Console.csproj">
|
<ProjectReference Include="..\DiscImageChef.Console\DiscImageChef.Console.csproj">
|
||||||
|
|||||||
@@ -1,3 +1,10 @@
|
|||||||
|
2017-05-27 Natalia Portillo <claunia@claunia.com>
|
||||||
|
|
||||||
|
* Commands/Ls.cs:
|
||||||
|
* Commands/Analyze.cs:
|
||||||
|
* Commands/ExtractFiles.cs:
|
||||||
|
Refactor: Move filesystem identification code to Core.
|
||||||
|
|
||||||
2017-05-27 Natalia Portillo <claunia@claunia.com>
|
2017-05-27 Natalia Portillo <claunia@claunia.com>
|
||||||
|
|
||||||
* Commands/DumpMedia.cs:
|
* Commands/DumpMedia.cs:
|
||||||
|
|||||||
@@ -164,7 +164,7 @@ namespace DiscImageChef.Commands
|
|||||||
{
|
{
|
||||||
DicConsole.WriteLine("Identifying filesystem on partition");
|
DicConsole.WriteLine("Identifying filesystem on partition");
|
||||||
|
|
||||||
IdentifyFilesystems(_imageFormat, out id_plugins, partitions[i].PartitionStartSector, partitions[i].PartitionStartSector + partitions[i].PartitionSectors);
|
Core.Filesystems.Identify(_imageFormat, out id_plugins, partitions[i].PartitionStartSector, partitions[i].PartitionStartSector + partitions[i].PartitionSectors);
|
||||||
if(id_plugins.Count == 0)
|
if(id_plugins.Count == 0)
|
||||||
DicConsole.WriteLine("Filesystem not identified");
|
DicConsole.WriteLine("Filesystem not identified");
|
||||||
else if(id_plugins.Count > 1)
|
else if(id_plugins.Count > 1)
|
||||||
@@ -197,7 +197,7 @@ namespace DiscImageChef.Commands
|
|||||||
|
|
||||||
if(checkraw)
|
if(checkraw)
|
||||||
{
|
{
|
||||||
IdentifyFilesystems(_imageFormat, out id_plugins, 0, _imageFormat.GetSectors() - 1);
|
Core.Filesystems.Identify(_imageFormat, out id_plugins, 0, _imageFormat.GetSectors() - 1);
|
||||||
if(id_plugins.Count == 0)
|
if(id_plugins.Count == 0)
|
||||||
DicConsole.WriteLine("Filesystem not identified");
|
DicConsole.WriteLine("Filesystem not identified");
|
||||||
else if(id_plugins.Count > 1)
|
else if(id_plugins.Count > 1)
|
||||||
@@ -233,19 +233,6 @@ namespace DiscImageChef.Commands
|
|||||||
|
|
||||||
Core.Statistics.AddCommand("analyze");
|
Core.Statistics.AddCommand("analyze");
|
||||||
}
|
}
|
||||||
|
|
||||||
static void IdentifyFilesystems(ImagePlugin imagePlugin, out List<string> id_plugins, ulong partitionStart, ulong partitionEnd)
|
|
||||||
{
|
|
||||||
id_plugins = new List<string>();
|
|
||||||
PluginBase plugins = new PluginBase();
|
|
||||||
plugins.RegisterAllPlugins();
|
|
||||||
|
|
||||||
foreach(Filesystem _plugin in plugins.PluginsList.Values)
|
|
||||||
{
|
|
||||||
if(_plugin.Identify(imagePlugin, partitionStart, partitionEnd))
|
|
||||||
id_plugins.Add(_plugin.Name.ToLower());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -154,7 +154,7 @@ namespace DiscImageChef.Commands
|
|||||||
|
|
||||||
DicConsole.WriteLine("Identifying filesystem on partition");
|
DicConsole.WriteLine("Identifying filesystem on partition");
|
||||||
|
|
||||||
IdentifyFilesystems(_imageFormat, out id_plugins, partitions[i].PartitionStartSector, partitions[i].PartitionStartSector + partitions[i].PartitionSectors);
|
Core.Filesystems.Identify(_imageFormat, out id_plugins, partitions[i].PartitionStartSector, partitions[i].PartitionStartSector + partitions[i].PartitionSectors);
|
||||||
if(id_plugins.Count == 0)
|
if(id_plugins.Count == 0)
|
||||||
DicConsole.WriteLine("Filesystem not identified");
|
DicConsole.WriteLine("Filesystem not identified");
|
||||||
else if(id_plugins.Count > 1)
|
else if(id_plugins.Count > 1)
|
||||||
@@ -214,7 +214,7 @@ namespace DiscImageChef.Commands
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
IdentifyFilesystems(_imageFormat, out id_plugins, 0, _imageFormat.GetSectors() - 1);
|
Core.Filesystems.Identify(_imageFormat, out id_plugins, 0, _imageFormat.GetSectors() - 1);
|
||||||
if(id_plugins.Count == 0)
|
if(id_plugins.Count == 0)
|
||||||
DicConsole.WriteLine("Filesystem not identified");
|
DicConsole.WriteLine("Filesystem not identified");
|
||||||
else if(id_plugins.Count > 1)
|
else if(id_plugins.Count > 1)
|
||||||
@@ -381,19 +381,6 @@ namespace DiscImageChef.Commands
|
|||||||
|
|
||||||
Core.Statistics.AddCommand("ls");
|
Core.Statistics.AddCommand("ls");
|
||||||
}
|
}
|
||||||
|
|
||||||
static void IdentifyFilesystems(ImagePlugin imagePlugin, out List<string> id_plugins, ulong partitionStart, ulong partitionEnd)
|
|
||||||
{
|
|
||||||
id_plugins = new List<string>();
|
|
||||||
PluginBase plugins = new PluginBase();
|
|
||||||
plugins.RegisterAllPlugins();
|
|
||||||
|
|
||||||
foreach(Filesystem _plugin in plugins.PluginsList.Values)
|
|
||||||
{
|
|
||||||
if(_plugin.Identify(imagePlugin, partitionStart, partitionEnd))
|
|
||||||
id_plugins.Add(_plugin.Name.ToLower());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -143,7 +143,7 @@ namespace DiscImageChef.Commands
|
|||||||
|
|
||||||
DicConsole.WriteLine("Identifying filesystem on partition");
|
DicConsole.WriteLine("Identifying filesystem on partition");
|
||||||
|
|
||||||
IdentifyFilesystems(_imageFormat, out id_plugins, partitions[i].PartitionStartSector, partitions[i].PartitionStartSector + partitions[i].PartitionSectors);
|
Core.Filesystems.Identify(_imageFormat, out id_plugins, partitions[i].PartitionStartSector, partitions[i].PartitionStartSector + partitions[i].PartitionSectors);
|
||||||
if(id_plugins.Count == 0)
|
if(id_plugins.Count == 0)
|
||||||
DicConsole.WriteLine("Filesystem not identified");
|
DicConsole.WriteLine("Filesystem not identified");
|
||||||
else if(id_plugins.Count > 1)
|
else if(id_plugins.Count > 1)
|
||||||
@@ -203,7 +203,7 @@ namespace DiscImageChef.Commands
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
IdentifyFilesystems(_imageFormat, out id_plugins, 0, _imageFormat.GetSectors() - 1);
|
Core.Filesystems.Identify(_imageFormat, out id_plugins, 0, _imageFormat.GetSectors() - 1);
|
||||||
if(id_plugins.Count == 0)
|
if(id_plugins.Count == 0)
|
||||||
DicConsole.WriteLine("Filesystem not identified");
|
DicConsole.WriteLine("Filesystem not identified");
|
||||||
else if(id_plugins.Count > 1)
|
else if(id_plugins.Count > 1)
|
||||||
@@ -303,19 +303,6 @@ namespace DiscImageChef.Commands
|
|||||||
|
|
||||||
Core.Statistics.AddCommand("ls");
|
Core.Statistics.AddCommand("ls");
|
||||||
}
|
}
|
||||||
|
|
||||||
static void IdentifyFilesystems(ImagePlugin imagePlugin, out List<string> id_plugins, ulong partitionStart, ulong partitionEnd)
|
|
||||||
{
|
|
||||||
id_plugins = new List<string>();
|
|
||||||
PluginBase plugins = new PluginBase();
|
|
||||||
plugins.RegisterAllPlugins();
|
|
||||||
|
|
||||||
foreach(Filesystem _plugin in plugins.PluginsList.Values)
|
|
||||||
{
|
|
||||||
if(_plugin.Identify(imagePlugin, partitionStart, partitionEnd))
|
|
||||||
id_plugins.Add(_plugin.Name.ToLower());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user