/***************************************************************************
The Disc Image Chef
----------------------------------------------------------------------------
Filename : Checksum.cs
Version : 1.0
Author(s) : Natalia Portillo
Component : Verbs.
Revision : $Revision$
Last change by : $Author$
Date : $Date$
--[ Description ] ----------------------------------------------------------
Implements the 'checksum' verb.
--[ License ] --------------------------------------------------------------
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as
published by the Free Software Foundation, either version 3 of the
License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see .
----------------------------------------------------------------------------
Copyright (C) 2011-2014 Claunia.com
****************************************************************************/
//$Id$
using System;
using DiscImageChef.ImagePlugins;
using DiscImageChef.Checksums;
using System.Collections.Generic;
namespace DiscImageChef.Commands
{
public static class Checksum
{
public static void doChecksum(ChecksumSubOptions options)
{
if (MainClass.isDebug)
{
Console.WriteLine("--debug={0}", options.Debug);
Console.WriteLine("--verbose={0}", options.Verbose);
Console.WriteLine("--separated-tracks={0}", options.SeparatedTracks);
Console.WriteLine("--whole-disc={0}", options.WholeDisc);
Console.WriteLine("--input={0}", options.InputFile);
Console.WriteLine("--adler32={0}", options.DoAdler32);
Console.WriteLine("--crc16={0}", options.DoCRC16);
Console.WriteLine("--crc32={0}", options.DoCRC32);
Console.WriteLine("--crc64={0}", options.DoCRC64);
Console.WriteLine("--md5={0}", options.DoMD5);
Console.WriteLine("--ripemd160={0}", options.DoRIPEMD160);
Console.WriteLine("--sha1={0}", options.DoSHA1);
Console.WriteLine("--sha256={0}", options.DoSHA256);
Console.WriteLine("--sha384={0}", options.DoSHA384);
Console.WriteLine("--sha512={0}", options.DoSHA512);
}
//throw new NotImplementedException("Checksumming not yet implemented.");
ImagePlugin inputFormat = ImageFormat.Detect(options.InputFile);
if (inputFormat == null)
{
Console.WriteLine("Unable to recognize image format, not checksumming");
return;
}
inputFormat.OpenImage(options.InputFile);
if (options.SeparatedTracks)
{
try
{
List