author | Ross Qin <ross.qin@nokia.com> |
Tue, 02 Nov 2010 09:31:04 +0800 | |
changeset 671 | ff8ff850b0cf |
parent 626 | ac03b93ca9c4 |
permissions | -rw-r--r-- |
605 | 1 |
/* |
2 |
* Copyright (c) 2010 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 |
#ifndef __FAT_IMAGE_GENERATER_HEADER__ |
|
18 |
#define __FAT_IMAGE_GENERATER_HEADER__ |
|
19 |
||
20 |
#include "fatdefines.h" |
|
21 |
||
22 |
#include <iostream> |
|
23 |
#include <list> |
|
24 |
#include <fstream> |
|
25 |
using namespace std ; |
|
26 |
const unsigned int KBufferedIOBytes = 0x800000 ; // 8M |
|
27 |
const unsigned int KMaxClusterBytes = 0x8000; // 32K |
|
28 |
enum TSupportedFatType { |
|
29 |
EFatUnknown = 0, |
|
30 |
EFat16 = 1, |
|
31 |
EFat32 = 2 |
|
32 |
}; |
|
33 |
||
34 |
class TFSNode; |
|
35 |
class TFatCluster; |
|
36 |
typedef list<TFatCluster*> PFatClusterList ; |
|
37 |
typedef list<TFatCluster*>::iterator Interator ; |
|
38 |
||
39 |
class TFatImgGenerator |
|
40 |
{ |
|
41 |
public : |
|
42 |
//The constructor , |
|
43 |
//a TFatImgGenerator is created and initialized, |
|
44 |
//if the parameters breaks the FAT specification, |
|
45 |
// then iType is set to EFatUnknown and thus |
|
46 |
// IsValid return false |
|
47 |
TFatImgGenerator(TSupportedFatType aType , ConfigurableFatAttributes& aAttr ); |
|
48 |
~TFatImgGenerator(); |
|
49 |
inline bool IsValid() const { return (EFatUnknown != iType);} |
|
50 |
||
51 |
//Create the FAT image, |
|
52 |
//If FAT image is not valid, or error accurs, return false |
|
53 |
bool Execute(TFSNode* aRootDir , const char* aOutputFile); |
|
54 |
protected : |
|
626
ac03b93ca9c4
ROM Tools 12.3.4 + RCOMP 8.4.2
Zheng Shen <zheng.shen@nokia.com>
parents:
605
diff
changeset
|
55 |
void InitAsFat16(TUint32 aTotalSectors, TUint16 aBytsPerSec); |
ac03b93ca9c4
ROM Tools 12.3.4 + RCOMP 8.4.2
Zheng Shen <zheng.shen@nokia.com>
parents:
605
diff
changeset
|
56 |
void InitAsFat32(TUint32 aTotalSectors, TUint16 aBytsPerSec); |
605 | 57 |
bool PrepareClusters(TUint& aNextClusIndex,TFSNode* aNode); |
58 |
TSupportedFatType iType ; |
|
59 |
char* iFatTable ; |
|
60 |
TUint iFatTableBytes ; |
|
61 |
TUint iTotalClusters ; |
|
62 |
TUint iBytsPerClus ; |
|
63 |
TFATBootSector iBootSector ; |
|
64 |
TFAT32BSExt iFat32Ext ; |
|
65 |
TFATHeader iFatHeader ; |
|
66 |
PFatClusterList iDataClusters ; |
|
67 |
}; |
|
68 |
||
69 |
||
70 |
#endif |