author | Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> |
Sat, 20 Feb 2010 00:10:51 +0200 | |
branch | RCL_3 |
changeset 19 | 4a8fed1c0ef6 |
parent 6 | 0173bcd7697c |
permissions | -rw-r--r-- |
0 | 1 |
// Copyright (c) 1995-2009 Nokia Corporation and/or its subsidiary(-ies). |
2 |
// All rights reserved. |
|
3 |
// This component and the accompanying materials are made available |
|
4 |
// under the terms of the License "Eclipse Public License v1.0" |
|
5 |
// which accompanies this distribution, and is available |
|
6 |
// at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
7 |
// |
|
8 |
// Initial Contributors: |
|
9 |
// Nokia Corporation - initial contribution. |
|
10 |
// |
|
11 |
// Contributors: |
|
12 |
// |
|
13 |
// Description: |
|
14 |
// f32\srom\sr_std.h |
|
15 |
// |
|
16 |
// |
|
17 |
||
18 |
#if defined(_UNICODE) |
|
19 |
#if !defined(UNICODE) |
|
20 |
#define UNICODE |
|
21 |
#endif |
|
22 |
#endif |
|
23 |
||
24 |
#include "common.h" |
|
25 |
#include <f32fsys.h> |
|
26 |
#include <f32ver.h> |
|
27 |
#include <e32rom.h> |
|
6
0173bcd7697c
Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
28 |
#include <e32svr.h> |
0 | 29 |
|
30 |
#if defined(__EPOC32__) |
|
31 |
// #define __PRINT_DEBUG_INFO_SR_STD__ 1 |
|
32 |
#endif |
|
33 |
||
34 |
#if defined(__PRINT_DEBUG_INFO_SR_STD__) && !defined(__LOCK_SR_STD__) |
|
35 |
#define __LOCK_SR_STD__ |
|
36 |
#define __PRINT(t) RDebug::t; |
|
37 |
#else |
|
38 |
#define __PRINT(t) |
|
39 |
#endif |
|
40 |
||
41 |
// |
|
42 |
enum TFault |
|
43 |
{ |
|
44 |
ERomReMountNotSupported, |
|
45 |
ERomGetFileInfo, |
|
46 |
ERomFileTooBig, |
|
47 |
ERomCreateFileMapping, |
|
48 |
ERomCreateMappedView, |
|
49 |
ERomInvalidArgument, |
|
50 |
ERomFsCorrupt |
|
51 |
}; |
|
52 |
// |
|
53 |
NONSHARABLE_CLASS(CRom) : public CFileSystem |
|
54 |
{ |
|
55 |
public: |
|
56 |
CRom(); |
|
57 |
~CRom(); |
|
58 |
TInt Install(); |
|
59 |
CMountCB* NewMountL() const; |
|
60 |
CFileCB* NewFileL() const; |
|
61 |
CDirCB* NewDirL() const; |
|
62 |
CFormatCB* NewFormatL() const; |
|
63 |
void DriveInfo(TDriveInfo& anInfo,TInt aDriveNumber) const; |
|
64 |
const TRomHeader& RomHeader() const {return(*iRomHeaderAddress);} |
|
65 |
TLinAddr RootDirectory() const {return UserSvr::RomRootDirectoryAddress();} |
|
66 |
private: |
|
67 |
static const TRomHeader* iRomHeaderAddress; |
|
68 |
}; |
|
69 |
// |
|
70 |
NONSHARABLE_CLASS(CRomMountCB) : public CMountCB, public CMountCB::MFileAccessor |
|
71 |
{ |
|
72 |
public: |
|
73 |
CRomMountCB(const CRom* aRom); |
|
74 |
void MountL(TBool aForceMount); |
|
75 |
TInt ReMount(); |
|
76 |
void Dismounted(); |
|
77 |
static TInt Compare(const TDesC& aLeft, const TDesC& aRight); |
|
78 |
void VolumeL(TVolumeInfo& aVolume) const; |
|
79 |
void SetVolumeL(TDes& aName); |
|
80 |
void MkDirL(const TDesC& aName); |
|
81 |
void RmDirL(const TDesC& aName); |
|
82 |
void DeleteL(const TDesC& aName); |
|
83 |
void RenameL(const TDesC& anOldName,const TDesC& anNewName); |
|
84 |
void ReplaceL(const TDesC& anOldName,const TDesC& anNewName); |
|
85 |
void EntryL(const TDesC& aName,TEntry& anEntry) const; |
|
86 |
void SetEntryL(const TDesC& aName,const TTime& aTime,TUint aMask,TUint aVal); |
|
87 |
void FileOpenL(const TDesC& aName,TUint aMode,TFileOpen anOpen,CFileCB* aFile); |
|
88 |
void DirOpenL(const TDesC& aName,CDirCB* aDir); |
|
89 |
void FindLeafDirL(const TDesC& aName,TLinAddr& aDir) const; |
|
90 |
void FindL(const TDesC& aName,TUint anAtt,TLinAddr aDir,TLinAddr& anEntry,TInt anError) const; |
|
91 |
void FindBinaryL(const TDesC& aName,TUint aAtt,TBool aAttKnown,TLinAddr aDir,TLinAddr& aEntry,TInt aError) const; |
|
92 |
void FindEntryL(const TDesC& aName,TUint anAtt,TBool aAttKnown,TLinAddr& aDir,TLinAddr& anEntry) const; |
|
93 |
const TRomHeader& RomHeader() const {return (iRom->RomHeader());} |
|
94 |
TLinAddr RomRootDirectory() const {return iRom->RootDirectory(); } |
|
95 |
void RawReadL(TInt64 aPos,TInt aLength,const TAny* aDes,TInt anOffset,const RMessagePtr2& aMessage) const; |
|
96 |
void RawWriteL(TInt64 aPos,TInt aLength,const TAny* aDes,TInt anOffset,const RMessagePtr2& aMessage); |
|
97 |
void ReadUidL(TLinAddr anAddr,TEntry& anEntry) const; |
|
98 |
void GetShortNameL(const TDesC& aLongName,TDes& aShortName); |
|
99 |
void GetLongNameL(const TDesC& aShortName,TDes& aLongName); |
|
100 |
void IsFileInRom(const TDesC& aFileName,TUint8*& aFileStart); |
|
101 |
void ReadSectionL(const TDesC& aName,TInt aPos,TAny* aTrg,TInt aLength,const RMessagePtr2& aMessage); |
|
102 |
virtual TInt GetInterface(TInt aInterfaceId,TAny*& aInterface,TAny* aInput); |
|
103 |
virtual TInt GetFileUniqueId(const TDesC& aName, TInt64& aUniqueId); |
|
104 |
virtual TInt Spare3(TInt aVal, TAny* aPtr1, TAny* aPtr2); |
|
105 |
virtual TInt Spare2(TInt aVal, TAny* aPtr1, TAny* aPtr2); |
|
106 |
virtual TInt Spare1(TInt aVal, TAny* aPtr1, TAny* aPtr2); |
|
107 |
||
108 |
private: |
|
109 |
const CRom* iRom; |
|
110 |
}; |
|
111 |
// |
|
112 |
NONSHARABLE_CLASS(CRomFileCB) : public CFileCB |
|
113 |
{ |
|
114 |
public: |
|
115 |
CRomFileCB(const CRom* aRom); |
|
116 |
void RenameL(const TDesC& aNewName); |
|
117 |
void ReadL(TInt aPos,TInt& aLength,const TAny* aTrg,const RMessagePtr2& aMessage); |
|
118 |
void WriteL(TInt aPos,TInt& aLength,const TAny* aSrc,const RMessagePtr2& aMessage); |
|
119 |
void SetSizeL(TInt aSize); |
|
120 |
void SetEntryL(const TTime& aTime,TUint aMask,TUint aVal); |
|
121 |
void FlushDataL(); |
|
122 |
void FlushAllL(); |
|
123 |
TInt Address(TInt& aPos) const; |
|
124 |
const TRomHeader& RomHeader() const {return(iRom->RomHeader());} |
|
125 |
TLinAddr RomRootDirectory() const {return iRom->RootDirectory(); } |
|
126 |
void SetBase(const TUint8* aBase) {iBase=aBase;} |
|
127 |
private: |
|
128 |
const CRom* iRom; |
|
129 |
const TUint8* iBase; |
|
130 |
}; |
|
131 |
// |
|
132 |
NONSHARABLE_CLASS(CRomDirCB) : public CDirCB |
|
133 |
{ |
|
134 |
public: |
|
135 |
CRomDirCB(const CRom* aRom); |
|
136 |
~CRomDirCB(); |
|
137 |
void ReadL(TEntry& anEntry); |
|
138 |
const TRomHeader& RomHeader() const {return(iRom->RomHeader());} |
|
139 |
TLinAddr RomRootDirectory() const {return iRom->RootDirectory(); } |
|
140 |
void SetDir(TLinAddr aDir,TLinAddr anEntry,const TDesC& aMatch); |
|
141 |
private: |
|
142 |
TBool MatchUid(); |
|
143 |
private: |
|
144 |
const CRom* iRom; |
|
145 |
TEntry iEntry; |
|
146 |
TLinAddr iDir; |
|
147 |
TLinAddr iNext; |
|
148 |
HBufC* iMatch; |
|
149 |
}; |
|
150 |
// |
|
151 |
GLREF_C TInt InstallFileSystem(CFileSystem* aSys,RLibrary aLib); |
|
152 |