imgtools/sisutils/inc/sisutils.h
changeset 0 044383f39525
child 590 360bd6b35136
equal deleted inserted replaced
-1:000000000000 0:044383f39525
       
     1 /*
       
     2 * Copyright (c) 2008-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 #ifndef __SISUTILS_H__
       
    20 #define __SISUTILS_H__
       
    21 
       
    22 #ifdef _MSC_VER 
       
    23 	#pragma warning(disable: 4786) // identifier was truncated to '255' characters in the debug information
       
    24 	#pragma warning(disable: 4503) // decorated name length exceeded, name was truncated
       
    25 #endif
       
    26 
       
    27 #include <string>
       
    28 #include <list>
       
    29 #include <iostream>
       
    30 #include <fstream>
       
    31 #include <iomanip>
       
    32 #undef _L
       
    33 
       
    34 #include <e32def.h>
       
    35 #include <e32cmn.h>
       
    36 
       
    37 #define STAT_SUCCESS  (0)
       
    38 #define STAT_FAILURE  (-1)
       
    39 
       
    40 #ifdef WIN32
       
    41 #define PATHSEPARATOR  "\\"
       
    42 #endif
       
    43 
       
    44 //typedefs
       
    45 typedef std::string String;
       
    46 
       
    47 /** 
       
    48 class SisUtils
       
    49 
       
    50 @internalComponent
       
    51 @released
       
    52 */
       
    53 class SisUtils
       
    54 {
       
    55 public:
       
    56 	SisUtils(char* aFile);
       
    57 	virtual ~SisUtils();
       
    58 
       
    59 	void SetVerboseMode();
       
    60 
       
    61 	virtual void ProcessSisFile() = 0;
       
    62 	virtual void GenerateOutput() = 0;
       
    63 
       
    64 	static String iExtractPath;
       
    65 	static String iOutputPath;
       
    66 
       
    67 protected:
       
    68 	TBool IsVerboseMode();
       
    69 	TBool IsFileExist(String aFile);
       
    70 	TBool MakeDirectory(String aPath);
       
    71 	String SisFileName();
       
    72 	TUint32 RunCommand(String cmd);
       
    73 	void TrimQuotes(String& aStr);
       
    74 
       
    75 private:
       
    76 	TBool iVerboseMode;
       
    77 	String iSisFile;
       
    78 };
       
    79 
       
    80 // SisUtils Exception handler
       
    81 class SisUtilsException
       
    82 {
       
    83 public:
       
    84 	SisUtilsException(char* aFile, char* aErrMessage);
       
    85 	virtual ~SisUtilsException();
       
    86 	virtual void Report();
       
    87 
       
    88 private:
       
    89 	String iSisFileName;
       
    90 	String iErrMessage;
       
    91 };
       
    92 
       
    93 
       
    94 #endif //__SISUTILS_H__