secureswitools/swisistools/source/makesis/makesis.h
changeset 0 ba25891c3a9e
child 25 98b66e4fb0be
child 62 5cc91383ab1e
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 * makesis main function
       
    16 *
       
    17 */
       
    18 
       
    19 
       
    20 /**
       
    21  @file 
       
    22  @internalComponent
       
    23  @released
       
    24 */
       
    25 
       
    26 #ifndef __MAKESIS_H__
       
    27 #define __MAKESIS_H__
       
    28 
       
    29 // ===========================================================================
       
    30 // INCLUDES
       
    31 // ===========================================================================
       
    32 
       
    33 #pragma warning(disable: 4786)
       
    34 #include "parsecmd.h"
       
    35 #include "packageparser.h"
       
    36 #include "utils.h"
       
    37 #include "siswrite.h"
       
    38 
       
    39 #include <string>
       
    40 #include <vector>
       
    41 
       
    42 typedef std::vector< std::pair<std::wstring, WORD> > InterpretSisErrors;
       
    43 typedef InterpretSisErrors::value_type InterpretSisError;
       
    44 // ===========================================================================
       
    45 // CLASS DEFINITION
       
    46 // ===========================================================================
       
    47 
       
    48 class CMakeSIS : public MParserObserver
       
    49 // The main application object. Controls the SIS file generation process
       
    50 	{
       
    51 public:
       
    52 	CMakeSIS();
       
    53 		
       
    54 	int  Run(int argc, wchar_t* argv[]);
       
    55 	
       
    56 	bool ParseSource();
       
    57 	bool WriteTarget();
       
    58 	
       
    59 public: // From MParserObserver
       
    60 	virtual void DoMsg(const wchar_t* aText) const;
       
    61 	virtual void DoVerbage(const wchar_t* aText) const;
       
    62 	virtual void DoErrMsg(const wchar_t* aText) const;
       
    63 	virtual bool Verbose() const;
       
    64 	virtual bool Dump() const;
       
    65 	virtual bool SetVerbose(bool aVerbose);
       
    66 	virtual void SetLineNumber(int aLineNumber);
       
    67 	virtual void AddInterpretSisError(TInterpretSisException aError);
       
    68 
       
    69 private:
       
    70 	void DoMsg(const wchar_t* aText1, const wchar_t* aText2) const;
       
    71 	void ShowBanner();
       
    72 	void ShowUsage ();
       
    73 	void ShowSyntax();
       
    74 	void ShowSSL ();
       
    75 	std::wstring GetVersionInfo(char *aRequest);
       
    76 	
       
    77 	void ShowUtilsError(TUtilsException err);
       
    78 	void ShowParseError(TParseException err);
       
    79 	void ShowCommandLineError(TCommandLineException err);
       
    80 	void AddErrMsg(const wchar_t* pszText);
       
    81 	void DisplayInterpretSisReport() const;
       
    82 	void ShowVersionFunctionSyntax() const;
       
    83 
       
    84 private:
       
    85 	int 				iLineNo;
       
    86 	bool 				iDump;
       
    87 	bool 				iVerbose;
       
    88 	CParseCmd			iCmdOptions;
       
    89 	InterpretSisErrors	iInterpretSisReport;
       
    90 	};
       
    91 
       
    92 
       
    93 //Inline member functions
       
    94 
       
    95 inline bool CMakeSIS::Verbose() const
       
    96 	{
       
    97 	return iVerbose; 
       
    98 	}
       
    99 
       
   100 inline bool CMakeSIS::Dump() const
       
   101 	{
       
   102 	return iDump; 
       
   103 	}
       
   104 
       
   105 inline bool CMakeSIS::SetVerbose(bool aVerbose)
       
   106 	{
       
   107 	bool prev = iVerbose; 
       
   108 	iVerbose = aVerbose; 
       
   109 	return prev; 
       
   110 	}
       
   111 
       
   112 inline void CMakeSIS::SetLineNumber(int aLineNumber)
       
   113 	{
       
   114 	iLineNo = aLineNumber; 
       
   115 	}
       
   116 
       
   117 
       
   118 #endif // __MAKESIS_H__