mirror of
https://github.com/aaru-dps/Aaru.git
synced 2025-12-16 19:24:25 +00:00
Added specific console handling for standard, verbose, debug
and error outputs.
This commit is contained in:
@@ -1,3 +1,11 @@
|
||||
2015-10-18 Natalia Portillo <claunia@claunia.com>
|
||||
|
||||
* PrintHex.cs:
|
||||
* DateHandlers.cs:
|
||||
* DiscImageChef.Helpers.csproj:
|
||||
Added specific console handling for standard, verbose, debug
|
||||
and error outputs.
|
||||
|
||||
2015-10-05 Natalia Portillo <claunia@claunia.com>
|
||||
|
||||
* PrintHex.cs:
|
||||
|
||||
@@ -37,6 +37,7 @@ Copyright (C) 2011-2014 Claunia.com
|
||||
//$Id$
|
||||
|
||||
using System;
|
||||
using DiscImageChef.Console;
|
||||
|
||||
namespace DiscImageChef
|
||||
{
|
||||
@@ -79,62 +80,54 @@ namespace DiscImageChef
|
||||
fourcharvalue[1] = VDDateTime[1];
|
||||
fourcharvalue[2] = VDDateTime[2];
|
||||
fourcharvalue[3] = VDDateTime[3];
|
||||
//if (MainClass.isDebug)
|
||||
Console.WriteLine("DEBUG (ISO9600ToDateTime handler): year = \"{0}\"", StringHandlers.CToString(fourcharvalue));
|
||||
DicConsole.DebugWriteLine("ISO9600ToDateTime handler", "year = \"{0}\"", StringHandlers.CToString(fourcharvalue));
|
||||
if (!Int32.TryParse(StringHandlers.CToString(fourcharvalue), out year))
|
||||
year = 0;
|
||||
// year = Convert.ToInt32(StringHandlers.CToString(fourcharvalue));
|
||||
|
||||
twocharvalue[0] = VDDateTime[4];
|
||||
twocharvalue[1] = VDDateTime[5];
|
||||
//if (MainClass.isDebug)
|
||||
Console.WriteLine("DEBUG (ISO9600ToDateTime handler): month = \"{0}\"", StringHandlers.CToString(twocharvalue));
|
||||
DicConsole.DebugWriteLine("ISO9600ToDateTime handler", "month = \"{0}\"", StringHandlers.CToString(twocharvalue));
|
||||
if (!Int32.TryParse(StringHandlers.CToString(twocharvalue), out month))
|
||||
month = 0;
|
||||
// month = Convert.ToInt32(StringHandlers.CToString(twocharvalue));
|
||||
|
||||
twocharvalue[0] = VDDateTime[6];
|
||||
twocharvalue[1] = VDDateTime[7];
|
||||
//if (MainClass.isDebug)
|
||||
Console.WriteLine("DEBUG (ISO9600ToDateTime handler): day = \"{0}\"", StringHandlers.CToString(twocharvalue));
|
||||
DicConsole.DebugWriteLine("ISO9600ToDateTime handler", "day = \"{0}\"", StringHandlers.CToString(twocharvalue));
|
||||
if (!Int32.TryParse(StringHandlers.CToString(twocharvalue), out day))
|
||||
day = 0;
|
||||
// day = Convert.ToInt32(StringHandlers.CToString(twocharvalue));
|
||||
|
||||
twocharvalue[0] = VDDateTime[8];
|
||||
twocharvalue[1] = VDDateTime[9];
|
||||
//if (MainClass.isDebug)
|
||||
Console.WriteLine("DEBUG (ISO9600ToDateTime handler): hour = \"{0}\"", StringHandlers.CToString(twocharvalue));
|
||||
DicConsole.DebugWriteLine("ISO9600ToDateTime handler", "hour = \"{0}\"", StringHandlers.CToString(twocharvalue));
|
||||
if (!Int32.TryParse(StringHandlers.CToString(twocharvalue), out hour))
|
||||
hour = 0;
|
||||
// hour = Convert.ToInt32(StringHandlers.CToString(twocharvalue));
|
||||
|
||||
twocharvalue[0] = VDDateTime[10];
|
||||
twocharvalue[1] = VDDateTime[11];
|
||||
//if (MainClass.isDebug)
|
||||
Console.WriteLine("DEBUG (ISO9600ToDateTime handler): minute = \"{0}\"", StringHandlers.CToString(twocharvalue));
|
||||
DicConsole.DebugWriteLine("ISO9600ToDateTime handler", "minute = \"{0}\"", StringHandlers.CToString(twocharvalue));
|
||||
if (!Int32.TryParse(StringHandlers.CToString(twocharvalue), out minute))
|
||||
minute = 0;
|
||||
// minute = Convert.ToInt32(StringHandlers.CToString(twocharvalue));
|
||||
|
||||
twocharvalue[0] = VDDateTime[12];
|
||||
twocharvalue[1] = VDDateTime[13];
|
||||
//if (MainClass.isDebug)
|
||||
Console.WriteLine("DEBUG (ISO9600ToDateTime handler): second = \"{0}\"", StringHandlers.CToString(twocharvalue));
|
||||
DicConsole.DebugWriteLine("ISO9600ToDateTime handler", "second = \"{0}\"", StringHandlers.CToString(twocharvalue));
|
||||
if (!Int32.TryParse(StringHandlers.CToString(twocharvalue), out second))
|
||||
second = 0;
|
||||
// second = Convert.ToInt32(StringHandlers.CToString(twocharvalue));
|
||||
|
||||
twocharvalue[0] = VDDateTime[14];
|
||||
twocharvalue[1] = VDDateTime[15];
|
||||
//if (MainClass.isDebug)
|
||||
Console.WriteLine("DEBUG (ISO9600ToDateTime handler): hundredths = \"{0}\"", StringHandlers.CToString(twocharvalue));
|
||||
DicConsole.DebugWriteLine("ISO9600ToDateTime handler", "hundredths = \"{0}\"", StringHandlers.CToString(twocharvalue));
|
||||
if (!Int32.TryParse(StringHandlers.CToString(twocharvalue), out hundredths))
|
||||
hundredths = 0;
|
||||
// hundredths = Convert.ToInt32(StringHandlers.CToString(twocharvalue));
|
||||
|
||||
//if (MainClass.isDebug)
|
||||
Console.WriteLine("DEBUG (ISO9600ToDateTime handler): decodedDT = new DateTime({0}, {1}, {2}, {3}, {4}, {5}, {6}, DateTimeKind.Unspecified);", year, month, day, hour, minute, second, hundredths * 10);
|
||||
DicConsole.DebugWriteLine("ISO9600ToDateTime handler", "decodedDT = new DateTime({0}, {1}, {2}, {3}, {4}, {5}, {6}, DateTimeKind.Unspecified);", year, month, day, hour, minute, second, hundredths * 10);
|
||||
DateTime decodedDT = new DateTime(year, month, day, hour, minute, second, hundredths * 10, DateTimeKind.Unspecified);
|
||||
|
||||
return decodedDT;
|
||||
|
||||
@@ -44,4 +44,10 @@
|
||||
<Compile Include="Swapping.cs" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\DiscImageChef.Console\DiscImageChef.Console.csproj">
|
||||
<Project>{CCAA7AFE-C094-4D82-A66D-630DE8A3F545}</Project>
|
||||
<Name>DiscImageChef.Console</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
@@ -36,6 +36,7 @@ Copyright (C) 2011-2014 Claunia.com
|
||||
****************************************************************************/
|
||||
//$Id$
|
||||
using System;
|
||||
using DiscImageChef.Console;
|
||||
|
||||
namespace DiscImageChef
|
||||
{
|
||||
@@ -43,7 +44,7 @@ namespace DiscImageChef
|
||||
{
|
||||
public static void PrintHexArray(byte[] array, int width)
|
||||
{
|
||||
Console.WriteLine(ByteArrayToHexArrayString(array, width));
|
||||
DicConsole.WriteLine(ByteArrayToHexArrayString(array, width));
|
||||
}
|
||||
|
||||
public static string ByteArrayToHexArrayString(byte[] array, int width)
|
||||
@@ -63,12 +64,12 @@ namespace DiscImageChef
|
||||
{
|
||||
if (subcounter == 3 )
|
||||
{
|
||||
Console.Write(" ");
|
||||
sb.Append(" ");
|
||||
subcounter = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
Console.Write(" ");
|
||||
sb.Append(" ");
|
||||
subcounter++;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user