19 |
19 |
20 |
20 |
21 #ifndef __R_DRIVEIMAGE_H__ |
21 #ifndef __R_DRIVEIMAGE_H__ |
22 #define __R_DRIVEIMAGE_H__ |
22 #define __R_DRIVEIMAGE_H__ |
23 |
23 |
24 #if defined(__MSVCDOTNET__) || defined(__TOOLS2__) |
24 #include <fstream> |
25 #include <fstream> |
|
26 #else //!__MSVCDOTNET__ |
|
27 #include <fstream.h> |
|
28 #endif |
|
29 |
|
30 #include "filesysteminterface.h" |
|
31 #include <vector> |
25 #include <vector> |
32 |
|
33 typedef std::vector<void*> EntryReferenceVector; |
|
34 typedef std::list<CDirectory*> EntryList; |
|
35 |
26 |
36 const TInt KMaxGenBuffer=0x14; |
27 const TInt KMaxGenBuffer=0x14; |
37 |
28 |
38 // Node Type. |
29 // Node Type. |
39 enum KNodeType |
30 enum KNodeType |
43 KNodeTypeChild, |
34 KNodeTypeChild, |
44 KNodeTypeSibling |
35 KNodeTypeSibling |
45 }; |
36 }; |
46 |
37 |
47 // File Format Supported. |
38 // File Format Supported. |
48 struct DriveFileFormatSupported |
|
49 { |
|
50 const char* iDriveFileFormat; |
|
51 enum TFileSystem iFileSystem; |
|
52 }; |
|
53 |
39 |
|
40 class TFSNode ; |
54 // Image creation class. |
41 // Image creation class. |
55 class CDriveImage |
42 class CDriveImage |
56 { |
43 { |
57 public: |
44 public: |
58 CDriveImage(CObeyFile *aObey); |
45 CDriveImage(CObeyFile *aObey); |
59 ~CDriveImage(); |
46 ~CDriveImage(); |
60 TInt CreateImage(TText* alogfile); |
47 TInt CreateImage(const char* alogfile); |
61 static TBool FormatTranslation(TText* aUserFileFormat,enum TFileSystem& aDriveFileFormat); |
48 |
62 |
|
63 private: |
49 private: |
64 |
50 |
65 TInt CreateList(); |
51 TFSNode* PrepareFileSystem(TRomNode* aRomNode); |
66 TInt GenTreeTraverse(TRomNode* anode,enum KNodeType anodeType); |
|
67 TInt CreateDirOrFileEntry(TRomNode* atempnode,enum KNodeType aType); |
|
68 TInt ConstructOptions(); |
|
69 TInt PlaceFileTemporary(const TInt afileSize,TRomNode* acurrentNode); |
|
70 TInt DeleteTempFolder(char* aTempDirName); |
|
71 |
|
72 private: |
|
73 |
|
74 // Holds the address of CObeyFile object. used to get the object information. |
52 // Holds the address of CObeyFile object. used to get the object information. |
75 CObeyFile *iObey; |
53 CObeyFile *iObey; |
76 // Container required for file sysem module. |
54 |
77 EntryList iNodeList; |
55 |
78 // Pointer for nested Container. |
|
79 EntryList *iParentInnerList; |
|
80 |
|
81 // For temp storge of Container address. |
|
82 EntryReferenceVector iNodeAddStore; |
|
83 |
|
84 // For file format support. |
|
85 static DriveFileFormatSupported iFormatType[]; |
|
86 // Reference variable used for converting tree to list. |
|
87 TInt iListReference; |
|
88 // Holds temp folder name. |
|
89 char *iTempDirName; |
|
90 // Pointer to buffer, which will be used for compression/un-compression purpose. |
|
91 char *iData; |
|
92 }; |
56 }; |
93 |
57 |
94 #endif |
58 #endif |