First public contribution.
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".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
30 #if defined(__EPOC32__)
31 // #define __PRINT_DEBUG_INFO_SR_STD__ 1
34 #if defined(__PRINT_DEBUG_INFO_SR_STD__) && !defined(__LOCK_SR_STD__)
35 #define __LOCK_SR_STD__
36 #define __PRINT(t) RDebug::t;
44 ERomReMountNotSupported,
47 ERomCreateFileMapping,
53 NONSHARABLE_CLASS(CRom) : public CFileSystem
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();}
67 static const TRomHeader* iRomHeaderAddress;
70 NONSHARABLE_CLASS(CRomMountCB) : public CMountCB, public CMountCB::MFileAccessor
73 CRomMountCB(const CRom* aRom);
74 void MountL(TBool aForceMount);
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);
112 NONSHARABLE_CLASS(CRomFileCB) : public CFileCB
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);
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;}
132 NONSHARABLE_CLASS(CRomDirCB) : public CDirCB
135 CRomDirCB(const CRom* aRom);
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);
151 GLREF_C TInt InstallFileSystem(CFileSystem* aSys,RLibrary aLib);