secureswitools/swianalysistoolkit/source/chainvalidityandinstallfilestatustools/dumpchainvaliditytool/options.h
changeset 0 ba25891c3a9e
equal deleted inserted replaced
-1:000000000000 0:ba25891c3a9e
       
     1 /*
       
     2 * Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of the License "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description: 
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 /**
       
    20  @file 
       
    21  @internalComponent 
       
    22 */
       
    23 
       
    24 #ifndef	__OPTIONS_H__
       
    25 #define	__OPTIONS_H__
       
    26 #pragma warning( disable : 4786) 
       
    27 
       
    28 #include "launchprocess.h"
       
    29 #include <string>
       
    30 #include <vector>
       
    31 #include <iomanip>
       
    32 #include <sstream>
       
    33 #include <iostream>
       
    34 #include <windows.h>
       
    35 #include <algorithm>
       
    36 
       
    37 
       
    38 int const KMajorVersion = 1 ;
       
    39 int const KMinorVersion = 0 ; 
       
    40 
       
    41 /**
       
    42  * Exceptions raised while processing the command line
       
    43  * @internalComponent
       
    44  */
       
    45 enum Exceptions
       
    46 	{
       
    47 	EUnknownOption ,
       
    48 	EMissingDATFile ,
       
    49 	ESupportingExeError ,
       
    50 	EMissingSISFile ,
       
    51 	EUnableToOpenFile ,
       
    52 	EErrorExecutingSupportingExeDumpsis ,
       
    53 	EErrorExecutingSupportingExeSignsis ,
       
    54 	EErrorExecutingSupportingDumpSwiCertstoreExe,
       
    55 	ECorruptCCIFile ,
       
    56 	ENotADerBitString ,
       
    57 	ENotADerSequence ,
       
    58 	ENotADerInteger ,
       
    59 	ENotADerUtf8String
       
    60 	};
       
    61 
       
    62 /**
       
    63   Contains the command line options
       
    64   @internalComponent
       
    65  */
       
    66 class Options
       
    67 {
       
    68 public:
       
    69 
       
    70 	Options(int argc, char** argv);
       
    71 	~Options();
       
    72 	static void			DisplayUsage ();
       
    73 	bool				List () const { return iList; }
       
    74 	static void			DisplayError( const Exceptions& aError);
       
    75 	std::string			SISFile () const { return iSISFile; }
       
    76 	bool				Version () const { return iVersion; }
       
    77 	std::string			CertstoreFile () const {return iCertstore ; }
       
    78 	static const char*	CommandName () { return "DumpChainValidityTool"; }
       
    79 	
       
    80 private:
       
    81 
       
    82 	void				DisplayVersion () const;
       
    83 	void				CheckCmdLineExceptions();
       
    84 
       
    85 	
       
    86 private:
       
    87 
       
    88 	bool						iList;
       
    89 	bool						iVersion;
       
    90 	bool						iHelpFlag;
       
    91 	bool						iDATFileSpecified;
       
    92 	bool						iSISFileSpecified;
       
    93 	bool						iDirectorySpecified;
       
    94 	std::string					iDATFile;
       
    95 	std::string					iCertstore;
       
    96 	std::string					iSISFile;
       
    97 };
       
    98 
       
    99 #endif