Update to Rider project version 2017.3.

This commit is contained in:
2017-12-27 23:55:20 +00:00
parent 0d034ce4d0
commit e009d86fcc
4 changed files with 142 additions and 103 deletions

View File

@@ -0,0 +1,5 @@
<component name="ProjectCodeStyleConfiguration">
<state>
<option name="PREFERRED_PROJECT_CODE_STYLE" value="Default" />
</state>
</component>

View File

@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<project version="4"> <project version="4">
<component name="ContentModelStore"> <component name="ContentModelStore">
<e p="$USER_HOME$/.Rider2017.2/system/resharper-host/local/Transient/ReSharperHost/v10/SolutionCaches/_DiscImageChef.73225794.00" t="ExcludeRecursive" /> <e p="$USER_HOME$/.Rider2017.3/system/resharper-host/local/Transient/ReSharperHost/v11/SolutionCaches/_DiscImageChef.73225794.00" t="ExcludeRecursive" />
<e p="$PROJECT_DIR$" t="IncludeFlat"> <e p="$PROJECT_DIR$" t="IncludeFlat">
<e p=".github" t="Include"> <e p=".github" t="Include">
<e p="CODE_OF_CONDUCT.md" t="Include" /> <e p="CODE_OF_CONDUCT.md" t="Include" />

View File

@@ -56,6 +56,8 @@ namespace DiscImageChef.Commands
FiltersList filtersList = new FiltersList(); FiltersList filtersList = new FiltersList();
IFilter inputFilter = filtersList.GetFilter(options.InputFile); IFilter inputFilter = filtersList.GetFilter(options.InputFile);
Dictionary<string, string> optionsDict =
new Dictionary<string, string> {{"debug", options.Debug.ToString()}};
if(inputFilter == null) if(inputFilter == null)
{ {
@@ -159,9 +161,11 @@ namespace DiscImageChef.Commands
{ {
DicConsole.WriteLine($"As identified by {plugin.Name}."); DicConsole.WriteLine($"As identified by {plugin.Name}.");
IReadOnlyFilesystem fs = (IReadOnlyFilesystem)plugin IReadOnlyFilesystem fs = (IReadOnlyFilesystem)plugin
.GetType().GetConstructor(Type.EmptyTypes)?.Invoke(new object[] { }); .GetType()
.GetConstructor(Type.EmptyTypes)
?.Invoke(new object[] { });
error = fs.Mount(imageFormat, partitions[i], encoding, options.Debug); error = fs.Mount(imageFormat, partitions[i], encoding, optionsDict);
if(error == Errno.NoError) if(error == Errno.NoError)
{ {
List<string> rootDir = new List<string>(); List<string> rootDir = new List<string>();
@@ -190,7 +194,8 @@ namespace DiscImageChef.Commands
foreach(string xattr in xattrs) foreach(string xattr in xattrs)
{ {
byte[] xattrBuf = new byte[0]; byte[] xattrBuf = new byte[0];
error = fs.GetXattr(entry, xattr, ref xattrBuf); error =
fs.GetXattr(entry, xattr, ref xattrBuf);
if(error != Errno.NoError) continue; if(error != Errno.NoError) continue;
Directory Directory
@@ -212,23 +217,25 @@ namespace DiscImageChef.Commands
outputFile.Write(xattrBuf, 0, xattrBuf.Length); outputFile.Write(xattrBuf, 0, xattrBuf.Length);
outputFile.Close(); outputFile.Close();
FileInfo fi = new FileInfo(outputPath); FileInfo fi = new FileInfo(outputPath);
#pragma warning disable RECS0022 // A catch clause that catches System.Exception and has an empty body #pragma warning disable RECS0022 // A catch clause that catches System.Exception and has an empty body
try { fi.CreationTimeUtc = stat.CreationTimeUtc; } try { fi.CreationTimeUtc = stat.CreationTimeUtc; }
catch catch
{ {
// ignored // ignored
} }
try { fi.LastWriteTimeUtc = stat.LastWriteTimeUtc; } try { fi.LastWriteTimeUtc = stat.LastWriteTimeUtc; }
catch catch
{ {
// ignored // ignored
} }
try { fi.LastAccessTimeUtc = stat.AccessTimeUtc; } try { fi.LastAccessTimeUtc = stat.AccessTimeUtc; }
catch catch
{ {
// ignored // ignored
} }
#pragma warning restore RECS0022 // A catch clause that catches System.Exception and has an empty body #pragma warning restore RECS0022 // A catch clause that catches System.Exception and has an empty body
DicConsole DicConsole
.WriteLine("Written {0} bytes of xattr {1} from file {2} to {3}", .WriteLine("Written {0} bytes of xattr {1} from file {2} to {3}",
xattrBuf.Length, xattr, entry, xattrBuf.Length, xattr, entry,
@@ -263,23 +270,25 @@ namespace DiscImageChef.Commands
outputFile.Write(outBuf, 0, outBuf.Length); outputFile.Write(outBuf, 0, outBuf.Length);
outputFile.Close(); outputFile.Close();
FileInfo fi = new FileInfo(outputPath); FileInfo fi = new FileInfo(outputPath);
#pragma warning disable RECS0022 // A catch clause that catches System.Exception and has an empty body #pragma warning disable RECS0022 // A catch clause that catches System.Exception and has an empty body
try { fi.CreationTimeUtc = stat.CreationTimeUtc; } try { fi.CreationTimeUtc = stat.CreationTimeUtc; }
catch catch
{ {
// ignored // ignored
} }
try { fi.LastWriteTimeUtc = stat.LastWriteTimeUtc; } try { fi.LastWriteTimeUtc = stat.LastWriteTimeUtc; }
catch catch
{ {
// ignored // ignored
} }
try { fi.LastAccessTimeUtc = stat.AccessTimeUtc; } try { fi.LastAccessTimeUtc = stat.AccessTimeUtc; }
catch catch
{ {
// ignored // ignored
} }
#pragma warning restore RECS0022 // A catch clause that catches System.Exception and has an empty body #pragma warning restore RECS0022 // A catch clause that catches System.Exception and has an empty body
DicConsole.WriteLine("Written {0} bytes of file {1} to {2}", DicConsole.WriteLine("Written {0} bytes of file {1} to {2}",
outBuf.Length, entry, outputPath); outBuf.Length, entry, outputPath);
} }
@@ -310,8 +319,9 @@ namespace DiscImageChef.Commands
plugins.ReadOnlyFilesystems.TryGetValue(idPlugins[0], out plugin); plugins.ReadOnlyFilesystems.TryGetValue(idPlugins[0], out plugin);
DicConsole.WriteLine($"Identified by {plugin.Name}."); DicConsole.WriteLine($"Identified by {plugin.Name}.");
IReadOnlyFilesystem fs = (IReadOnlyFilesystem)plugin IReadOnlyFilesystem fs = (IReadOnlyFilesystem)plugin
.GetType().GetConstructor(Type.EmptyTypes)?.Invoke(new object[] { }); .GetType().GetConstructor(Type.EmptyTypes)
error = fs.Mount(imageFormat, partitions[i], encoding, options.Debug); ?.Invoke(new object[] { });
error = fs.Mount(imageFormat, partitions[i], encoding, optionsDict);
if(error == Errno.NoError) if(error == Errno.NoError)
{ {
List<string> rootDir = new List<string>(); List<string> rootDir = new List<string>();
@@ -360,23 +370,25 @@ namespace DiscImageChef.Commands
outputFile.Write(xattrBuf, 0, xattrBuf.Length); outputFile.Write(xattrBuf, 0, xattrBuf.Length);
outputFile.Close(); outputFile.Close();
FileInfo fi = new FileInfo(outputPath); FileInfo fi = new FileInfo(outputPath);
#pragma warning disable RECS0022 // A catch clause that catches System.Exception and has an empty body #pragma warning disable RECS0022 // A catch clause that catches System.Exception and has an empty body
try { fi.CreationTimeUtc = stat.CreationTimeUtc; } try { fi.CreationTimeUtc = stat.CreationTimeUtc; }
catch catch
{ {
// ignored // ignored
} }
try { fi.LastWriteTimeUtc = stat.LastWriteTimeUtc; } try { fi.LastWriteTimeUtc = stat.LastWriteTimeUtc; }
catch catch
{ {
// ignored // ignored
} }
try { fi.LastAccessTimeUtc = stat.AccessTimeUtc; } try { fi.LastAccessTimeUtc = stat.AccessTimeUtc; }
catch catch
{ {
// ignored // ignored
} }
#pragma warning restore RECS0022 // A catch clause that catches System.Exception and has an empty body #pragma warning restore RECS0022 // A catch clause that catches System.Exception and has an empty body
DicConsole DicConsole
.WriteLine("Written {0} bytes of xattr {1} from file {2} to {3}", .WriteLine("Written {0} bytes of xattr {1} from file {2} to {3}",
xattrBuf.Length, xattr, entry, outputPath); xattrBuf.Length, xattr, entry, outputPath);
@@ -408,23 +420,25 @@ namespace DiscImageChef.Commands
outputFile.Write(outBuf, 0, outBuf.Length); outputFile.Write(outBuf, 0, outBuf.Length);
outputFile.Close(); outputFile.Close();
FileInfo fi = new FileInfo(outputPath); FileInfo fi = new FileInfo(outputPath);
#pragma warning disable RECS0022 // A catch clause that catches System.Exception and has an empty body #pragma warning disable RECS0022 // A catch clause that catches System.Exception and has an empty body
try { fi.CreationTimeUtc = stat.CreationTimeUtc; } try { fi.CreationTimeUtc = stat.CreationTimeUtc; }
catch catch
{ {
// ignored // ignored
} }
try { fi.LastWriteTimeUtc = stat.LastWriteTimeUtc; } try { fi.LastWriteTimeUtc = stat.LastWriteTimeUtc; }
catch catch
{ {
// ignored // ignored
} }
try { fi.LastAccessTimeUtc = stat.AccessTimeUtc; } try { fi.LastAccessTimeUtc = stat.AccessTimeUtc; }
catch catch
{ {
// ignored // ignored
} }
#pragma warning restore RECS0022 // A catch clause that catches System.Exception and has an empty body #pragma warning restore RECS0022 // A catch clause that catches System.Exception and has an empty body
DicConsole.WriteLine("Written {0} bytes of file {1} to {2}", DicConsole.WriteLine("Written {0} bytes of file {1} to {2}",
outBuf.Length, entry, outputPath); outBuf.Length, entry, outputPath);
} }
@@ -466,8 +480,9 @@ namespace DiscImageChef.Commands
{ {
DicConsole.WriteLine($"As identified by {plugin.Name}."); DicConsole.WriteLine($"As identified by {plugin.Name}.");
IReadOnlyFilesystem fs = (IReadOnlyFilesystem)plugin IReadOnlyFilesystem fs = (IReadOnlyFilesystem)plugin
.GetType().GetConstructor(Type.EmptyTypes)?.Invoke(new object[] { }); .GetType().GetConstructor(Type.EmptyTypes)
error = fs.Mount(imageFormat, wholePart, encoding, options.Debug); ?.Invoke(new object[] { });
error = fs.Mount(imageFormat, wholePart, encoding, optionsDict);
if(error == Errno.NoError) if(error == Errno.NoError)
{ {
List<string> rootDir = new List<string>(); List<string> rootDir = new List<string>();
@@ -516,23 +531,25 @@ namespace DiscImageChef.Commands
outputFile.Write(xattrBuf, 0, xattrBuf.Length); outputFile.Write(xattrBuf, 0, xattrBuf.Length);
outputFile.Close(); outputFile.Close();
FileInfo fi = new FileInfo(outputPath); FileInfo fi = new FileInfo(outputPath);
#pragma warning disable RECS0022 // A catch clause that catches System.Exception and has an empty body #pragma warning disable RECS0022 // A catch clause that catches System.Exception and has an empty body
try { fi.CreationTimeUtc = stat.CreationTimeUtc; } try { fi.CreationTimeUtc = stat.CreationTimeUtc; }
catch catch
{ {
// ignored // ignored
} }
try { fi.LastWriteTimeUtc = stat.LastWriteTimeUtc; } try { fi.LastWriteTimeUtc = stat.LastWriteTimeUtc; }
catch catch
{ {
// ignored // ignored
} }
try { fi.LastAccessTimeUtc = stat.AccessTimeUtc; } try { fi.LastAccessTimeUtc = stat.AccessTimeUtc; }
catch catch
{ {
// ignored // ignored
} }
#pragma warning restore RECS0022 // A catch clause that catches System.Exception and has an empty body #pragma warning restore RECS0022 // A catch clause that catches System.Exception and has an empty body
DicConsole DicConsole
.WriteLine("Written {0} bytes of xattr {1} from file {2} to {3}", .WriteLine("Written {0} bytes of xattr {1} from file {2} to {3}",
xattrBuf.Length, xattr, entry, outputPath); xattrBuf.Length, xattr, entry, outputPath);
@@ -564,23 +581,25 @@ namespace DiscImageChef.Commands
outputFile.Write(outBuf, 0, outBuf.Length); outputFile.Write(outBuf, 0, outBuf.Length);
outputFile.Close(); outputFile.Close();
FileInfo fi = new FileInfo(outputPath); FileInfo fi = new FileInfo(outputPath);
#pragma warning disable RECS0022 // A catch clause that catches System.Exception and has an empty body #pragma warning disable RECS0022 // A catch clause that catches System.Exception and has an empty body
try { fi.CreationTimeUtc = stat.CreationTimeUtc; } try { fi.CreationTimeUtc = stat.CreationTimeUtc; }
catch catch
{ {
// ignored // ignored
} }
try { fi.LastWriteTimeUtc = stat.LastWriteTimeUtc; } try { fi.LastWriteTimeUtc = stat.LastWriteTimeUtc; }
catch catch
{ {
// ignored // ignored
} }
try { fi.LastAccessTimeUtc = stat.AccessTimeUtc; } try { fi.LastAccessTimeUtc = stat.AccessTimeUtc; }
catch catch
{ {
// ignored // ignored
} }
#pragma warning restore RECS0022 // A catch clause that catches System.Exception and has an empty body #pragma warning restore RECS0022 // A catch clause that catches System.Exception and has an empty body
DicConsole.WriteLine("Written {0} bytes of file {1} to {2}", DicConsole.WriteLine("Written {0} bytes of file {1} to {2}",
outBuf.Length, entry, outputPath); outBuf.Length, entry, outputPath);
} }
@@ -606,9 +625,9 @@ namespace DiscImageChef.Commands
{ {
plugins.ReadOnlyFilesystems.TryGetValue(idPlugins[0], out plugin); plugins.ReadOnlyFilesystems.TryGetValue(idPlugins[0], out plugin);
DicConsole.WriteLine($"Identified by {plugin.Name}."); DicConsole.WriteLine($"Identified by {plugin.Name}.");
IReadOnlyFilesystem fs = (IReadOnlyFilesystem)plugin IReadOnlyFilesystem fs =
.GetType().GetConstructor(Type.EmptyTypes)?.Invoke(new object[] { }); (IReadOnlyFilesystem)plugin.GetType().GetConstructor(Type.EmptyTypes)?.Invoke(new object[] { });
error = fs.Mount(imageFormat, wholePart, encoding, options.Debug); error = fs.Mount(imageFormat, wholePart, encoding, optionsDict);
if(error == Errno.NoError) if(error == Errno.NoError)
{ {
List<string> rootDir = new List<string>(); List<string> rootDir = new List<string>();
@@ -655,23 +674,25 @@ namespace DiscImageChef.Commands
outputFile.Write(xattrBuf, 0, xattrBuf.Length); outputFile.Write(xattrBuf, 0, xattrBuf.Length);
outputFile.Close(); outputFile.Close();
FileInfo fi = new FileInfo(outputPath); FileInfo fi = new FileInfo(outputPath);
#pragma warning disable RECS0022 // A catch clause that catches System.Exception and has an empty body #pragma warning disable RECS0022 // A catch clause that catches System.Exception and has an empty body
try { fi.CreationTimeUtc = stat.CreationTimeUtc; } try { fi.CreationTimeUtc = stat.CreationTimeUtc; }
catch catch
{ {
// ignored // ignored
} }
try { fi.LastWriteTimeUtc = stat.LastWriteTimeUtc; } try { fi.LastWriteTimeUtc = stat.LastWriteTimeUtc; }
catch catch
{ {
// ignored // ignored
} }
try { fi.LastAccessTimeUtc = stat.AccessTimeUtc; } try { fi.LastAccessTimeUtc = stat.AccessTimeUtc; }
catch catch
{ {
// ignored // ignored
} }
#pragma warning restore RECS0022 // A catch clause that catches System.Exception and has an empty body #pragma warning restore RECS0022 // A catch clause that catches System.Exception and has an empty body
DicConsole DicConsole
.WriteLine("Written {0} bytes of xattr {1} from file {2} to {3}", .WriteLine("Written {0} bytes of xattr {1} from file {2} to {3}",
xattrBuf.Length, xattr, entry, outputPath); xattrBuf.Length, xattr, entry, outputPath);
@@ -701,23 +722,25 @@ namespace DiscImageChef.Commands
outputFile.Write(outBuf, 0, outBuf.Length); outputFile.Write(outBuf, 0, outBuf.Length);
outputFile.Close(); outputFile.Close();
FileInfo fi = new FileInfo(outputPath); FileInfo fi = new FileInfo(outputPath);
#pragma warning disable RECS0022 // A catch clause that catches System.Exception and has an empty body #pragma warning disable RECS0022 // A catch clause that catches System.Exception and has an empty body
try { fi.CreationTimeUtc = stat.CreationTimeUtc; } try { fi.CreationTimeUtc = stat.CreationTimeUtc; }
catch catch
{ {
// ignored // ignored
} }
try { fi.LastWriteTimeUtc = stat.LastWriteTimeUtc; } try { fi.LastWriteTimeUtc = stat.LastWriteTimeUtc; }
catch catch
{ {
// ignored // ignored
} }
try { fi.LastAccessTimeUtc = stat.AccessTimeUtc; } try { fi.LastAccessTimeUtc = stat.AccessTimeUtc; }
catch catch
{ {
// ignored // ignored
} }
#pragma warning restore RECS0022 // A catch clause that catches System.Exception and has an empty body #pragma warning restore RECS0022 // A catch clause that catches System.Exception and has an empty body
DicConsole.WriteLine("Written {0} bytes of file {1} to {2}", outBuf.Length, DicConsole.WriteLine("Written {0} bytes of file {1} to {2}", outBuf.Length,
entry, outputPath); entry, outputPath);
} }

View File

@@ -52,6 +52,8 @@ namespace DiscImageChef.Commands
FiltersList filtersList = new FiltersList(); FiltersList filtersList = new FiltersList();
IFilter inputFilter = filtersList.GetFilter(options.InputFile); IFilter inputFilter = filtersList.GetFilter(options.InputFile);
Dictionary<string, string> optionsDict =
new Dictionary<string, string> {{"debug", options.Debug.ToString()}};
if(inputFilter == null) if(inputFilter == null)
{ {
@@ -146,17 +148,20 @@ namespace DiscImageChef.Commands
{ {
DicConsole.WriteLine($"As identified by {plugin.Name}."); DicConsole.WriteLine($"As identified by {plugin.Name}.");
IReadOnlyFilesystem fs = (IReadOnlyFilesystem)plugin IReadOnlyFilesystem fs = (IReadOnlyFilesystem)plugin
.GetType().GetConstructor(Type.EmptyTypes)?.Invoke(new object[] { }); .GetType()
.GetConstructor(Type.EmptyTypes)
?.Invoke(new object[] { });
if(fs == null) continue; if(fs == null) continue;
error = fs.Mount(imageFormat, partitions[i], encoding, options.Debug); error = fs.Mount(imageFormat, partitions[i], encoding, optionsDict);
if(error == Errno.NoError) if(error == Errno.NoError)
{ {
List<string> rootDir = new List<string>(); List<string> rootDir = new List<string>();
error = fs.ReadDir("/", out rootDir); error = fs.ReadDir("/", out rootDir);
if(error == Errno.NoError) if(error == Errno.NoError)
foreach(string entry in rootDir) DicConsole.WriteLine("{0}", entry); foreach(string entry in rootDir)
DicConsole.WriteLine("{0}", entry);
else else
DicConsole.ErrorWriteLine("Error {0} reading root directory {0}", DicConsole.ErrorWriteLine("Error {0} reading root directory {0}",
error.ToString()); error.ToString());
@@ -175,16 +180,18 @@ namespace DiscImageChef.Commands
DicConsole.WriteLine($"Identified by {plugin.Name}."); DicConsole.WriteLine($"Identified by {plugin.Name}.");
IReadOnlyFilesystem fs = (IReadOnlyFilesystem)plugin IReadOnlyFilesystem fs = (IReadOnlyFilesystem)plugin
.GetType().GetConstructor(Type.EmptyTypes)?.Invoke(new object[] { }); .GetType().GetConstructor(Type.EmptyTypes)
?.Invoke(new object[] { });
if(fs == null) continue; if(fs == null) continue;
error = fs.Mount(imageFormat, partitions[i], encoding, options.Debug); error = fs.Mount(imageFormat, partitions[i], encoding, optionsDict);
if(error == Errno.NoError) if(error == Errno.NoError)
{ {
List<string> rootDir = new List<string>(); List<string> rootDir = new List<string>();
error = fs.ReadDir("/", out rootDir); error = fs.ReadDir("/", out rootDir);
if(error == Errno.NoError) if(error == Errno.NoError)
foreach(string entry in rootDir) DicConsole.WriteLine("{0}", entry); foreach(string entry in rootDir)
DicConsole.WriteLine("{0}", entry);
else else
DicConsole.ErrorWriteLine("Error {0} reading root directory {0}", error.ToString()); DicConsole.ErrorWriteLine("Error {0} reading root directory {0}", error.ToString());
@@ -213,16 +220,18 @@ namespace DiscImageChef.Commands
{ {
DicConsole.WriteLine($"As identified by {plugin.Name}."); DicConsole.WriteLine($"As identified by {plugin.Name}.");
IReadOnlyFilesystem fs = (IReadOnlyFilesystem)plugin IReadOnlyFilesystem fs = (IReadOnlyFilesystem)plugin
.GetType().GetConstructor(Type.EmptyTypes)?.Invoke(new object[] { }); .GetType().GetConstructor(Type.EmptyTypes)
?.Invoke(new object[] { });
if(fs == null) continue; if(fs == null) continue;
error = fs.Mount(imageFormat, wholePart, encoding, options.Debug); error = fs.Mount(imageFormat, wholePart, encoding, optionsDict);
if(error == Errno.NoError) if(error == Errno.NoError)
{ {
List<string> rootDir = new List<string>(); List<string> rootDir = new List<string>();
error = fs.ReadDir("/", out rootDir); error = fs.ReadDir("/", out rootDir);
if(error == Errno.NoError) if(error == Errno.NoError)
foreach(string entry in rootDir) DicConsole.WriteLine("{0}", entry); foreach(string entry in rootDir)
DicConsole.WriteLine("{0}", entry);
else else
DicConsole.ErrorWriteLine("Error {0} reading root directory {0}", error.ToString()); DicConsole.ErrorWriteLine("Error {0} reading root directory {0}", error.ToString());
@@ -237,11 +246,12 @@ namespace DiscImageChef.Commands
if(plugin != null) if(plugin != null)
{ {
DicConsole.WriteLine($"Identified by {plugin.Name}."); DicConsole.WriteLine($"Identified by {plugin.Name}.");
IReadOnlyFilesystem fs = (IReadOnlyFilesystem)plugin IReadOnlyFilesystem fs =
(IReadOnlyFilesystem)plugin
.GetType().GetConstructor(Type.EmptyTypes)?.Invoke(new object[] { }); .GetType().GetConstructor(Type.EmptyTypes)?.Invoke(new object[] { });
if(fs != null) if(fs != null)
{ {
error = fs.Mount(imageFormat, wholePart, encoding, options.Debug); error = fs.Mount(imageFormat, wholePart, encoding, optionsDict);
if(error == Errno.NoError) if(error == Errno.NoError)
{ {
List<string> rootDir = new List<string>(); List<string> rootDir = new List<string>();
@@ -273,7 +283,8 @@ namespace DiscImageChef.Commands
} }
else DicConsole.WriteLine("{0}", entry); else DicConsole.WriteLine("{0}", entry);
} }
else DicConsole.WriteLine("{0}", entry); else
DicConsole.WriteLine("{0}", entry);
else else
DicConsole.ErrorWriteLine("Error {0} reading root directory {0}", error.ToString()); DicConsole.ErrorWriteLine("Error {0} reading root directory {0}", error.ToString());