imgtools/sisutils/inc/sisutils.h
author Mike Kinghan <mikek@symbian.org>
Thu, 25 Nov 2010 13:59:07 +0000
changeset 40 68f68128601f
parent 6 787612182dd0
permissions -rwxr-xr-x
1) Add the sbsv1 components from sftools/dev/build to make the linux_build package independent of the obsolete buildtools package. 2) Enhance romnibus.pl so that it generate the symbol file for the built rom when invoked by Raptor 3) Make the maksym.pl tool portable for Linux as well as Windows. 4) Remove the of armasm2as.pl from the e32tools component in favour of the copy now exported from sbsv1/e32util.

/*
* Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
* All rights reserved.
* This component and the accompanying materials are made available
* under the terms of the License "Eclipse Public License v1.0"
* which accompanies this distribution, and is available
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
*
* Initial Contributors:
* Nokia Corporation - initial contribution.
*
* Contributors:
*
* Description: 
*
*/


#ifndef __SISUTILS_H__
#define __SISUTILS_H__

#ifdef _MSC_VER 
	#pragma warning(disable: 4786) // identifier was truncated to '255' characters in the debug information
	#pragma warning(disable: 4503) // decorated name length exceeded, name was truncated
#endif

#include <string>
#include <list>
#include <iostream>
#include <fstream>
#include <iomanip>
#undef _L

#include <e32def.h>
#include <e32cmn.h>

#define STAT_SUCCESS  (0)
#define STAT_FAILURE  (-1)

#ifdef WIN32
#define PATHSEPARATOR  "\\"
#endif
#ifdef __LINUX__
#define PATHSEPARATOR  "/"
#endif

//typedefs
typedef std::string String;

/** 
class SisUtils

@internalComponent
@released
*/
class SisUtils
{
public:
	SisUtils(char const* aFile);
	virtual ~SisUtils();

	void SetVerboseMode();

	virtual void ProcessSisFile() = 0;
	virtual void GenerateOutput() = 0;

	static String iExtractPath;
	static String iOutputPath;

protected:
	TBool IsVerboseMode();
	TBool IsFileExist(String aFile);
	TBool MakeDirectory(String aPath);
	String SisFileName();
	TUint32 RunCommand(String cmd);
	void TrimQuotes(String& aStr);

private:
	TBool iVerboseMode;
	String iSisFile;
};

// SisUtils Exception handler
class SisUtilsException
{
public:
	SisUtilsException(char const* aFile, char const* aErrMessage);
	virtual ~SisUtilsException();
	virtual void Report();

private:
	String iSisFileName;
	String iErrMessage;
};


#endif //__SISUTILS_H__