imgtools/romtools/readimage/inc/image_reader.h
changeset 590 360bd6b35136
parent 0 044383f39525
--- a/imgtools/romtools/readimage/inc/image_reader.h	Wed Jun 16 16:51:40 2010 +0300
+++ b/imgtools/romtools/readimage/inc/image_reader.h	Wed Jun 23 16:56:47 2010 +0800
@@ -1,76 +1,81 @@
-/*
-* Copyright (c) 2005-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: 
-* @internalComponent
-* @released
-*
-*/
-
-
-#ifndef __IMAGE_READER__
-#define __IMAGE_READER__
-
-#if defined(__VC32__) && (_MSC_VER < 1300)
-#pragma warning(disable:4786) // std::map etc overflow debug symbol length :(
-#endif
-
-
-#include "common.h"
-#include <direct.h>
-#include <map>
-
-typedef struct tag_FILEINFO
-{
-	TUint32 iOffset;
-	TUint32 iSize;
-}FILEINFO, *PFILEINFO;
-
-typedef std::map<std::string, PFILEINFO> FILEINFOMAP;
-
-class ImageReader
-{
-public:
-	ImageReader(const char* aFile);
-	virtual ~ImageReader();
-	
-	virtual void ReadImage()	= 0;
-	virtual void ProcessImage() = 0;
-	virtual void Validate()		= 0;
-	virtual void Dump()			= 0;
-	
-	virtual void ExtractImageContents(){}
-	void DumpData(TUint* aData, TUint aLength);
-
-	void SetDisplayOptions(TUint32);
-	bool DisplayOptions(TUint32);
-
-	void ExtractFile(TUint aOffset, TInt aSize, const char* aFileName, const char* aPath, char* aFilePath,char* aData = NULL);
-	void FindAndInsertString(string& aSrcStr,string& aDelimiter,string& aAppStr);
-	void FindAndReplaceString(string& aSrcStr, string& aDelimiter, string& aReplStr);
-	void CreateSpecifiedDir(char* aSrcPath,const char* aDelimiter);
-	TBool IsDrive(char* aStr);
-
-	virtual void GetFileInfo(FILEINFOMAP& /*fileInfoMap */){}
-	void ExtractFileSet(char* aData);
-	int FileNameMatch(string aPattern, string aFileName, int aRecursiveFlag);
-
-	TUint32	iDisplayOptions;
-	string	iImgFileName;
-	static string  iZdrivePath;
-	static string  iLogFileName;
-	static string  iE32ImgFileName;
-	static string  iPattern;
-};
-
-#endif //__IMAGE_READER__
+/*
+* Copyright (c) 2005-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: 
+* @internalComponent
+* @released
+*
+*/
+
+
+#ifndef __IMAGE_READER__
+#define __IMAGE_READER__
+
+#if defined(__VC32__) && (_MSC_VER < 1300)
+#pragma warning(disable:4786) // map etc overflow debug symbol length :(
+#endif
+
+
+#include "common.h"
+#ifdef WIN32
+#include <direct.h>
+#else
+#include <unistd.h>
+#include <sys/stat.h>
+#endif
+#include <map>
+
+typedef struct tag_FILEINFO
+{
+	TUint32 iOffset;
+	TUint32 iSize;
+}FILEINFO, *PFILEINFO;
+
+typedef map<string, PFILEINFO> FILEINFOMAP;
+
+class ImageReader
+{
+public:
+	ImageReader(const char* aFile);
+	virtual ~ImageReader();
+	
+	virtual void ReadImage()	= 0;
+	virtual void ProcessImage() = 0;
+	virtual void Validate()		= 0;
+	virtual void Dump()			= 0;
+	
+	virtual void ExtractImageContents(){}
+	void DumpData(TUint* aData, TUint aLength);
+
+	void SetDisplayOptions(TUint32);
+	bool DisplayOptions(TUint32);
+
+	void ExtractFile(TUint aOffset, TInt aSize, const char* aFileName,const char* aPath,const char* aFilePath,const char* aData = NULL);
+	void FindAndInsertString(string& aSrcStr,string& aDelimiter,string& aAppStr);
+	void FindAndReplaceString(string& aSrcStr, string& aDelimiter, string& aReplStr);
+ 
+	void CreateSpecifiedDir(const string& aSrcPath);  
+
+	virtual void GetFileInfo(FILEINFOMAP& /*fileInfoMap */){}
+	void ExtractFileSet(const char* aData);
+	int FileNameMatch(const string& aPattern, const string& aFileName, int aRecursiveFlag);
+
+	TUint32	iDisplayOptions;
+	string	iImgFileName;
+	static string  iZdrivePath;
+	static string  iLogFileName;
+	static string  iE32ImgFileName;
+	static string  iPattern;
+};
+
+#endif //__IMAGE_READER__