imgtools/romtools/rofsbuild/r_obey.h
author kelvzhu
Tue, 27 Jul 2010 13:00:43 +0800
changeset 621 96fee2635b19
parent 607 378360dbbdba
child 626 ac03b93ca9c4
permissions -rw-r--r--
Fixed Bug 2413 for evalid
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
606
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
     1
/*
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
     2
* Copyright (c) 1995-2009 Nokia Corporation and/or its subsidiary(-ies).
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
     3
* All rights reserved.
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
     4
* This component and the accompanying materials are made available
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
     5
* under the terms of the License "Eclipse Public License v1.0"
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
     6
* which accompanies this distribution, and is available
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
     7
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
     8
*
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
     9
* Initial Contributors:
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
    10
* Nokia Corporation - initial contribution.
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
    11
*
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
    12
* Contributors:
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
    13
*
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
    14
* Description: 
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
    15
* @internalComponent * @released
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
    16
* OBY file reader and processing class Definition.
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
    17
*
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
    18
*/
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
    19
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
    20
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
    21
#ifndef __R_OBEY_H__
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
    22
#define __R_OBEY_H__
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
    23
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
    24
#define __REFERENCE_CAPABILITY_NAMES__
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
    25
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
    26
#include <stdio.h>
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
    27
#include <e32capability.h>
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
    28
#include <kernel/kernboot.h>
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
    29
#include "fatdefines.h"
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
    30
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
    31
#include <vector>
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
    32
#include <map>
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
    33
#include <fstream>
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
    34
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
    35
using namespace std;
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
    36
//
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
    37
const TUint32 KNumWords=16;
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
    38
//
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
    39
const TInt KDefaultRomSize=0x400000;
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
    40
const TInt KDefaultRomAlign=0x10;
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
    41
//
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
    42
typedef vector<string> StringVector ;
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
    43
typedef map<string, StringVector> KeywordMap;
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
    44
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
    45
enum EKeyword
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
    46
{
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
    47
	EKeywordNone=0,	// backwards compatibility, but now ignored
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
    48
	EKeywordFile,
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
    49
	EKeywordData,
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
    50
	EKeywordDir,
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
    51
	EKeywordRofsName,
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
    52
	EKeywordExtensionRofs, 
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
    53
	EKeywordCoreRofsName,
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
    54
	EKeywordRomSize,
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
    55
	EKeywordAlias,
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
    56
	EKeywordHide,
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
    57
	EKeywordRename,
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
    58
	EKeywordRofsSize,
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
    59
	EKeywordRofsChecksum,
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
    60
	EKeywordVersion,
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
    61
	EKeywordTime,
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
    62
	EKeywordRomChecksum,
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
    63
	EKeywordTrace,
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
    64
	EKeywordCoreImage,
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
    65
	EKeywordRofsAutoSize,
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
    66
	EKeywordFileCompress,
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
    67
	EKeywordFileUncompress,
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
    68
	EKeywordHideV2,
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
    69
	EKeywordPatchDllData,
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
    70
	EKeywordPagingOverride,
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
    71
	EKeywordCodePagingOverride,
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
    72
	EKeywordDataPagingOverride,
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
    73
	// Added to support data drive images.
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
    74
	EKeywordDataImageName,    
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
    75
	EKeywordDataImageFileSystem, 
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
    76
	EKeywordDataImageSize,
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
    77
	EKeywordDataImageVolume,
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
    78
	EKeywordDataImageSectorSize,
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
    79
	EKeywordDataImageNoOfFats,
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
    80
	EKeywordSmrImageName,
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
    81
	EKeywordSmrFileData,
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
    82
	EKeywordSmrFormatVersion,
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
    83
	EKeywordSmrFlags,
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
    84
	EKeywordSmrUID
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
    85
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
    86
};
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
    87
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
    88
enum EFileAttribute {
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
    89
	EAttributeAtt,
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
    90
	EAttributeAttExtra,
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
    91
//	EAttributeCompress,
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
    92
	EAttributeStack,
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
    93
	EAttributeFixed,
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
    94
	EAttributePriority,
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
    95
	EAttributeUid1,
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
    96
	EAttributeUid2,
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
    97
	EAttributeUid3,
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
    98
	EAttributeHeapMin,
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
    99
	EAttributeHeapMax,
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
   100
	EAttributeCapability,
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
   101
	EAttributeUnpaged,
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
   102
	EAttributePaged,
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
   103
	EAttributeUnpagedCode,
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
   104
	EAttributePagedCode,
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
   105
	EAttributeUnpagedData,
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
   106
	EAttributePagedData,
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
   107
	};
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
   108
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
   109
#include "r_romnode.h"
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
   110
#include "r_rofs.h"
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
   111
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
   112
class MRofsImage;
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
   113
 
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
   114
struct ObeyFileKeyword
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
   115
	{
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
   116
	const char* iKeyword;
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
   117
	size_t iKeywordLength;
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
   118
	TInt iPass;
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
   119
	TInt iNumArgs;		// -ve means >= number
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
   120
	enum EKeyword iKeywordEnum;
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
   121
	const char* iHelpText;
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
   122
	};
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
   123
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
   124
struct FileAttributeKeyword
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
   125
	{
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
   126
	const char* iKeyword;
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
   127
	size_t iKeywordLength;
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
   128
	TInt iIsFileAttribute;
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
   129
	TInt iNumArgs;
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
   130
	enum EFileAttribute iAttributeEnum;
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
   131
	const char* iHelpText;
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
   132
	};
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
   133
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
   134
class ObeyFileReader
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
   135
	{
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
   136
public:
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
   137
	ObeyFileReader(const char *aFileName);
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
   138
	~ObeyFileReader();
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
   139
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
   140
	static void KeywordHelp();
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
   141
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
   142
	TBool Open();
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
   143
	void Mark();
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
   144
	void MarkNext();
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
   145
	void Rewind();
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
   146
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
   147
	TInt NextLine(TInt aPass, enum EKeyword& aKeyword);
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
   148
	TInt NextAttribute(TInt& aIndex, TInt aHasFile, enum EFileAttribute& aKeyword, char*& aArg);
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
   149
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
   150
	char* DupWord(TInt aIndex) const;				// allocate copy of nth word
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
   151
	TInt Count() const { return iNumWords;}				// number of words on current line
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
   152
	const char* Word(TInt aIndex) const { return iWord[aIndex]; }	// return nth word as char* 
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
   153
	const char* Suffix() const { return iSuffix; } 			// return unmatched suffix of word[0]
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
   154
	TInt CurrentLine() const { return iCurrentLine;}				// number of words on current line
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
   155
	const char* GetCurrentObeyStatement() const {return iCurrentObeyStatement;}						// return current obey statement
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
   156
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
   157
	void ProcessTime(TInt64& aTime);
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
   158
	static void TimeNow(TInt64& aTime);
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
   159
private:
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
   160
	TInt ReadAndParseLine(); 
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
   161
	TInt Parse();
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
   162
	inline static TBool IsGap(char ch) {
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
   163
		return (ch==' ' || ch=='=' || ch=='\t');
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
   164
	}
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
   165
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
   166
	static const ObeyFileKeyword iKeywords[];
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
   167
	static const FileAttributeKeyword iAttributeKeywords[];
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
   168
	static TInt64 iTimeNow;
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
   169
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
   170
private:
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
   171
	TInt iCurrentLine; 
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
   172
	StringVector iLines ;
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
   173
	string iFileName;
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
   174
	TInt iNumWords;	
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
   175
	char* iLine;
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
   176
	TInt iMarkLine ;
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
   177
	char* iCurrentObeyStatement;
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
   178
	char iSuffix[80];
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
   179
	char* iWord[KNumWords];
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
   180
	};
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
   181
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
   182
class CPatchDataProcessor;
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
   183
// Configurable FAT attributes
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
   184
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
   185
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
   186
class CObeyFile
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
   187
	{
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
   188
public:
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
   189
	char* iRomFileName;
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
   190
	char* iExtensionRofsName;
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
   191
	char* iKernelRofsName;
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
   192
	TInt iRomSize;
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
   193
	TVersion iVersion;
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
   194
	TUint32 iCheckSum;
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
   195
	TInt iNumberOfFiles;
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
   196
	TInt64 iTime;
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
   197
	TRomNode* iRootDirectory;
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
   198
	TInt iNumberOfDataFiles;
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
   199
	// Added to support Data Drive Images.
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
   200
	char* iDriveFileName; 
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
   201
	char* iDriveFileFormat;
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
   202
	ConfigurableFatAttributes iConfigurableFatAttributes;
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
   203
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
   204
private:
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
   205
	ObeyFileReader& iReader;
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
   206
	TInt iMissingFiles;
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
   207
	TRomNode* iLastExecutable;
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
   208
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
   209
	TRomBuilderEntry* iFirstFile;
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
   210
	TRomBuilderEntry** iNextFilePtrPtr;
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
   211
	TRomBuilderEntry* iCurrentFile;
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
   212
	KeywordMap iKeyValues;
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
   213
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
   214
public:
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
   215
	CObeyFile(ObeyFileReader& aReader);
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
   216
	~CObeyFile();
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
   217
	void Release();
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
   218
	TInt ProcessRofs();
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
   219
	TInt ProcessExtensionRofs(MRofsImage* info);
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
   220
	TInt ProcessDataDrive();		//	Process the data drive obey file.
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
   221
	TRomBuilderEntry *FirstFile();
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
   222
	TRomBuilderEntry *NextFile();
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
   223
	char* ProcessCoreImage() const;
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
   224
	void SkipToExtension();
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
   225
	TBool AutoSize() const {return iAutoSize ;}
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
   226
	TUint32 AutoPageSize() const {return iAutoPageSize;} 
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
   227
	TBool Process();
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
   228
 
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
   229
	StringVector getValues(const string& aKey);
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
   230
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
   231
private:
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
   232
	TBool ProcessFile(TInt aAlign, enum EKeyword aKeyword);
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
   233
	TBool ProcessDriveFile(enum EKeyword aKeyword);               
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
   234
	TBool ProcessRenaming(enum EKeyword aKeyword);
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
   235
	TBool ProcessKeyword(enum EKeyword aKeyword);
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
   236
	TBool ProcessDriveKeyword(enum EKeyword aKeyword);
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
   237
	void ProcessExtensionKeyword(enum EKeyword aKeyword);
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
   238
	TInt ParseFileAttributes(TRomNode* aNode, TRomBuilderEntry* aFile, enum EKeyword aKeyword);
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
   239
	TInt ParseSection();
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
   240
	TBool ParsePatchDllData();
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
   241
	TBool GotKeyVariables();
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
   242
	TBool GotKeyDriveVariables();			// To check the data drive mandatory variables. 
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
   243
	TBool GotExtensionVariables(MRofsImage* aRom);
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
   244
	void AddFile(TRomBuilderEntry* aFile);
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
   245
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
   246
	TInt SetStackSize(TRomNode* aNode, const char *aStr);
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
   247
	TInt SetHeapSizeMin(TRomNode* aNode, const char *aStr);
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
   248
	TInt SetHeapSizeMax(TRomNode* aNode, const char *aStr);
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
   249
	TInt SetCapability(TRomNode* aNode, const char *aStr);
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
   250
	TInt SetUid1(TRomNode* aNode, const char *aStr);
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
   251
	TInt SetUid2(TRomNode* aNode, const char *aStr);
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
   252
	TInt SetUid3(TRomNode* aNode, const char *aStr);
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
   253
	TInt SetPriority(TRomNode* aNode, const char *aStr);
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
   254
	
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
   255
	static TBool GetNextBitOfFileName(char*& epocEndPtr);
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
   256
	static const char *IsValidFilePath(const char *aPath);
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
   257
	static const char* IsValidDirPath(const char* aPath);
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
   258
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
   259
	TBool iAutoSize;
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
   260
	TUint32 iAutoPageSize;
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
   261
	TBool iPagingOverrideParsed;
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
   262
	TBool iCodePagingOverrideParsed;
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
   263
	TBool iDataPagingOverrideParsed;
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
   264
public:
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
   265
	CPatchDataProcessor* iPatchData;	
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
   266
	void SplitPatchDataStatement(StringVector& aPatchDataTokens);	
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
   267
	};
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
   268
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
   269
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
   270
#endif