secureswitools/swisistools/source/makesis/parsecmd.h
changeset 0 ba25891c3a9e
equal deleted inserted replaced
-1:000000000000 0:ba25891c3a9e
       
     1 /*
       
     2 * Copyright (c) 1997-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 * handles parsing of makesis command line args
       
    16 *
       
    17 */
       
    18 
       
    19 
       
    20 /**
       
    21  @file 
       
    22  @internalComponent
       
    23  @released
       
    24 */
       
    25 
       
    26 #ifndef __PARSE_CMD_H_
       
    27 #define __PARSE_CMD_H_
       
    28 
       
    29 #include "fieldroot.h"
       
    30 #include "utils.h"
       
    31 
       
    32 // ===========================================================================
       
    33 // CONSTANTS
       
    34 // ===========================================================================
       
    35 
       
    36 #define SOURCEFILE		L".pkg"
       
    37 #define DESTFILE		L".sis"
       
    38 
       
    39 enum TCommandLineException
       
    40 	{ErrInsufficientArgs,
       
    41 	ErrBadCommandFlag,
       
    42 	ErrBadSourceFile,
       
    43 	ErrNoSourceFile,
       
    44 	ErrCannotOpenSourceFile,
       
    45 	ErrBadTargetFile
       
    46 	};
       
    47 
       
    48 // ===========================================================================
       
    49 // CLASS DEFINITION
       
    50 // ===========================================================================
       
    51 
       
    52 class CParseCmd
       
    53 // Responsable for processing and maintaining the command line options
       
    54 	{
       
    55 public:
       
    56 	CParseCmd();
       
    57 	
       
    58 	ParseCommandLine(int argc, _TCHAR *argv[]);
       
    59 	
       
    60 	bool  ShowSyntax ()						const { return iShowSyntax;	}
       
    61 	bool  ShowSSL ()						const { return iShowSSL;		}
       
    62 	bool  InterpretSisReport ()				const { return iInterpretSisReport; }
       
    63 	int Flags ()							const { return iOptions;		}
       
    64 	CSISFieldRoot::TDbgFlag DebugFlags ()	const { return iDebugOptions;	}
       
    65 	const wchar_t* SourceFile ()					const { return iSource;		}
       
    66 	const wchar_t* SearchPath ()					const { return iDir;		}
       
    67 	const wchar_t* TargetFile ();
       
    68 		
       
    69 	enum TOptions
       
    70 		{
       
    71 		EOptVerbose  = 0x01,
       
    72 		EOptMakeStub  = 0x02,
       
    73 		EOptDirectory = 0x04,
       
    74 		EOptPassword  = 0x08,
       
    75 		EOptDump	  = 0x10
       
    76 		};
       
    77 
       
    78 private:
       
    79 	void SetDirectory(const wchar_t* pszPath);
       
    80 	void SetSource(const wchar_t* pszSource);
       
    81 	void SetTarget(const wchar_t* pszTarget);
       
    82 		
       
    83 private:
       
    84 	wchar_t iDir[PATHMAX];
       
    85 	wchar_t iSource[PATHMAX];
       
    86 	wchar_t iTarget[PATHMAX];
       
    87 		
       
    88 	int		iOptions;
       
    89 	bool	iShowSyntax;
       
    90 	bool	iShowSSL;
       
    91 	bool	iInterpretSisReport;
       
    92 	CSISFieldRoot::TDbgFlag iDebugOptions;
       
    93 	};
       
    94 
       
    95 #endif // __PARSE_CMD_H_