imgtools/romtools/rofsbuild/r_obey.h
author Bob Rosenberg <bob.rosenberg@nokia.com>
Thu, 16 Sep 2010 17:45:27 +0100
changeset 657 5720fe8b820c
parent 626 ac03b93ca9c4
child 647 53d1ab72f5bc
permissions -rw-r--r--
joinsysdef wasn't properly translating the namespace prefix for "replace".
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,
626
ac03b93ca9c4 ROM Tools 12.3.4 + RCOMP 8.4.2
Zheng Shen <zheng.shen@nokia.com>
parents: 607
diff changeset
    79
	EKeywordDataImageClusterSize,
606
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
    80
	EKeywordDataImageNoOfFats,
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
    81
	EKeywordSmrImageName,
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
    82
	EKeywordSmrFileData,
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
    83
	EKeywordSmrFormatVersion,
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
    84
	EKeywordSmrFlags,
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
    85
	EKeywordSmrUID
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
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
    89
enum EFileAttribute {
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
    90
	EAttributeAtt,
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
    91
	EAttributeAttExtra,
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
    92
//	EAttributeCompress,
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
    93
	EAttributeStack,
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
    94
	EAttributeFixed,
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
    95
	EAttributePriority,
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
    96
	EAttributeUid1,
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
    97
	EAttributeUid2,
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
    98
	EAttributeUid3,
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
    99
	EAttributeHeapMin,
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
   100
	EAttributeHeapMax,
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
   101
	EAttributeCapability,
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
   102
	EAttributeUnpaged,
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
   103
	EAttributePaged,
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
   104
	EAttributeUnpagedCode,
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
   105
	EAttributePagedCode,
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
   106
	EAttributeUnpagedData,
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
   107
	EAttributePagedData,
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
   108
	};
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
   109
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
   110
#include "r_romnode.h"
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
   111
#include "r_rofs.h"
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
   112
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
   113
class MRofsImage;
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
   114
 
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
   115
struct ObeyFileKeyword
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
   116
	{
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
   117
	const char* iKeyword;
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
   118
	size_t iKeywordLength;
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
   119
	TInt iPass;
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
   120
	TInt iNumArgs;		// -ve means >= number
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
   121
	enum EKeyword iKeywordEnum;
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
   122
	const char* iHelpText;
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
   123
	};
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
   124
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
   125
struct FileAttributeKeyword
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
   126
	{
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
   127
	const char* iKeyword;
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
   128
	size_t iKeywordLength;
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
   129
	TInt iIsFileAttribute;
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
   130
	TInt iNumArgs;
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
   131
	enum EFileAttribute iAttributeEnum;
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
   132
	const char* iHelpText;
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
   133
	};
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
   134
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
   135
class ObeyFileReader
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
   136
	{
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
   137
public:
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
   138
	ObeyFileReader(const char *aFileName);
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
   139
	~ObeyFileReader();
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
   140
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
   141
	static void KeywordHelp();
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
   142
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
   143
	TBool Open();
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
   144
	void Mark();
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
   145
	void MarkNext();
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
   146
	void Rewind();
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
   147
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
   148
	TInt NextLine(TInt aPass, enum EKeyword& aKeyword);
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
   149
	TInt NextAttribute(TInt& aIndex, TInt aHasFile, enum EFileAttribute& aKeyword, char*& aArg);
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
   150
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
   151
	char* DupWord(TInt aIndex) const;				// allocate copy of nth word
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
   152
	TInt Count() const { return iNumWords;}				// number of words on current line
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
   153
	const char* Word(TInt aIndex) const { return iWord[aIndex]; }	// return nth word as char* 
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
   154
	const char* Suffix() const { return iSuffix; } 			// return unmatched suffix of word[0]
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
   155
	TInt CurrentLine() const { return iCurrentLine;}				// number of words on current line
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
   156
	const char* GetCurrentObeyStatement() const {return iCurrentObeyStatement;}						// return current obey statement
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
   157
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
   158
	void ProcessTime(TInt64& aTime);
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
   159
	static void TimeNow(TInt64& aTime);
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
   160
private:
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
   161
	TInt ReadAndParseLine(); 
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
   162
	TInt Parse();
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
   163
	inline static TBool IsGap(char ch) {
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
   164
		return (ch==' ' || ch=='=' || ch=='\t');
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
   165
	}
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
   166
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
   167
	static const ObeyFileKeyword iKeywords[];
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
   168
	static const FileAttributeKeyword iAttributeKeywords[];
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
   169
	static TInt64 iTimeNow;
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
   170
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
   171
private:
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
   172
	TInt iCurrentLine; 
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
   173
	StringVector iLines ;
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
   174
	string iFileName;
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
   175
	TInt iNumWords;	
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
   176
	char* iLine;
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
   177
	TInt iMarkLine ;
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
   178
	char* iCurrentObeyStatement;
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
   179
	char iSuffix[80];
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
   180
	char* iWord[KNumWords];
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
   181
	};
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
   182
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
   183
class CPatchDataProcessor;
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
   184
// Configurable FAT attributes
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
   185
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
   186
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
   187
class CObeyFile
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
   188
	{
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
   189
public:
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
   190
	char* iRomFileName;
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
   191
	char* iExtensionRofsName;
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
   192
	char* iKernelRofsName;
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
   193
	TInt iRomSize;
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
   194
	TVersion iVersion;
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
   195
	TUint32 iCheckSum;
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
   196
	TInt iNumberOfFiles;
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
   197
	TInt64 iTime;
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
   198
	TRomNode* iRootDirectory;
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
   199
	TInt iNumberOfDataFiles;
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
   200
	// Added to support Data Drive Images.
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
   201
	char* iDriveFileName; 
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
   202
	char* iDriveFileFormat;
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
   203
	ConfigurableFatAttributes iConfigurableFatAttributes;
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
   204
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
   205
private:
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
   206
	ObeyFileReader& iReader;
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
   207
	TInt iMissingFiles;
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
   208
	TRomNode* iLastExecutable;
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
   209
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
   210
	TRomBuilderEntry* iFirstFile;
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
   211
	TRomBuilderEntry** iNextFilePtrPtr;
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
   212
	TRomBuilderEntry* iCurrentFile;
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
   213
	KeywordMap iKeyValues;
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
   214
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
   215
public:
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
   216
	CObeyFile(ObeyFileReader& aReader);
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
   217
	~CObeyFile();
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
   218
	void Release();
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
   219
	TInt ProcessRofs();
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
   220
	TInt ProcessExtensionRofs(MRofsImage* info);
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
   221
	TInt ProcessDataDrive();		//	Process the data drive obey file.
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
   222
	TRomBuilderEntry *FirstFile();
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
   223
	TRomBuilderEntry *NextFile();
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
   224
	char* ProcessCoreImage() const;
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
   225
	void SkipToExtension();
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
   226
	TBool AutoSize() const {return iAutoSize ;}
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
   227
	TUint32 AutoPageSize() const {return iAutoPageSize;} 
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
   228
	TBool Process();
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
   229
 
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
   230
	StringVector getValues(const string& aKey);
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
   231
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
   232
private:
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
   233
	TBool ProcessFile(TInt aAlign, enum EKeyword aKeyword);
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
   234
	TBool ProcessDriveFile(enum EKeyword aKeyword);               
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
   235
	TBool ProcessRenaming(enum EKeyword aKeyword);
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
   236
	TBool ProcessKeyword(enum EKeyword aKeyword);
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
   237
	TBool ProcessDriveKeyword(enum EKeyword aKeyword);
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
   238
	void ProcessExtensionKeyword(enum EKeyword aKeyword);
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
   239
	TInt ParseFileAttributes(TRomNode* aNode, TRomBuilderEntry* aFile, enum EKeyword aKeyword);
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
   240
	TInt ParseSection();
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
   241
	TBool ParsePatchDllData();
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
   242
	TBool GotKeyVariables();
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
   243
	TBool GotKeyDriveVariables();			// To check the data drive mandatory variables. 
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
   244
	TBool GotExtensionVariables(MRofsImage* aRom);
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
   245
	void AddFile(TRomBuilderEntry* aFile);
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
   246
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
   247
	TInt SetStackSize(TRomNode* aNode, const char *aStr);
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
   248
	TInt SetHeapSizeMin(TRomNode* aNode, const char *aStr);
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
   249
	TInt SetHeapSizeMax(TRomNode* aNode, const char *aStr);
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
   250
	TInt SetCapability(TRomNode* aNode, const char *aStr);
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
   251
	TInt SetUid1(TRomNode* aNode, const char *aStr);
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
   252
	TInt SetUid2(TRomNode* aNode, const char *aStr);
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
   253
	TInt SetUid3(TRomNode* aNode, const char *aStr);
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
   254
	TInt SetPriority(TRomNode* aNode, const char *aStr);
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
   255
	
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
   256
	static TBool GetNextBitOfFileName(char*& epocEndPtr);
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
   257
	static const char *IsValidFilePath(const char *aPath);
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
   258
	static const char* IsValidDirPath(const char* aPath);
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
   259
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
   260
	TBool iAutoSize;
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
   261
	TUint32 iAutoPageSize;
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
   262
	TBool iPagingOverrideParsed;
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
   263
	TBool iCodePagingOverrideParsed;
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
   264
	TBool iDataPagingOverrideParsed;
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
   265
public:
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
   266
	CPatchDataProcessor* iPatchData;	
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
   267
	void SplitPatchDataStatement(StringVector& aPatchDataTokens);	
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
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 0
diff changeset
   271
#endif