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.
19 @file f32\inc\elocal.h
23 #if !defined(__ELOCAL_H__)
33 #define WIN32_LEAN_AND_MEAN
34 #pragma warning( disable : 4201 ) // nonstandard extension used : nameless struct/union
36 #pragma warning( default : 4201 ) // nonstandard extension used : nameless struct/union
44 EFileTimeToSystemTime,
46 EFileCloseSetAttributes,
56 class CLocalMountCB : public CMountCB,
57 public CMountCB::MFileExtendedInterface
62 void MountL(TBool aForceMount);
65 void VolumeL(TVolumeInfo& aVolume) const;
66 void SetVolumeL(TDes& aName);
67 void MkDirL(const TDesC& aName);
68 void RmDirL(const TDesC& aName);
69 void DeleteL(const TDesC& aName);
70 void RenameL(const TDesC& anOldName,const TDesC& anNewName);
71 void ReplaceL(const TDesC& anOldName,const TDesC& anNewName);
72 void EntryL(const TDesC& aName,TEntry& anEntry) const;
73 void SetEntryL(const TDesC& aName,const TTime& aTime,TUint aSetAttMask,TUint aClearAttMask);
74 void FileOpenL(const TDesC& aName,TUint aMode,TFileOpen anOpen,CFileCB* aFile);
75 void DirOpenL(const TDesC& aName,CDirCB* aDir);
76 void RawReadL(TInt64 aPos,TInt aLength,const TAny* aDes,TInt anOffset,const RMessagePtr2& aMessage) const;
77 void RawWriteL(TInt64 aPos,TInt aLength,const TAny* aDes,TInt anOffset,const RMessagePtr2& aMessage);
78 void ReadUidL(const TDesC& aName,TEntry& anEntry) const;
79 void GetShortNameL(const TDesC& aLongName,TDes& aShortName);
80 void GetLongNameL(const TDesC& aShortName,TDes& aLongName);
81 void IsFileInRom(const TDesC& aFileName,TUint8*& aFileStart);
82 void ReadSectionL(const TDesC& aName,TInt aPos,TAny* aTrg,TInt aLength, const RMessagePtr2& aMessage);
83 TInt LocalBufferSupport();
84 TInt MountControl(TInt aLevel, TInt aOption, TAny* aParam);
86 // interface extension implementation
87 virtual void ReadSection64L(const TDesC& aName, TInt64 aPos, TAny* aTrg, TInt aLength, const RMessagePtr2& aMessage);
90 inline TUint64 MaxFileSizeSupported() const {return iMaxFileSizeSupported;}
93 virtual TInt GetInterface(TInt aInterfaceId,TAny*& aInterface,TAny* aInput);
95 TBool IsRomDrive() const;
101 TUint64 iMaxFileSizeSupported; ///< Max. file size supported by HOST filesystem (4G-1 for FAT, 17,592,185,978,880 bytes for NTFS)
109 class CLocalFileCB : public CFileCB, public CFileCB::MExtendedFileInterface
114 void RenameL(const TDesC& aNewName);
115 void ReadL(TInt aPos,TInt& aLength,const TAny* aDes,const RMessagePtr2& aMessage);
116 void WriteL(TInt aPos,TInt& aLength,const TAny* aDes,const RMessagePtr2& aMessage);
117 TInt Address(TInt& aPos) const;
118 void SetSizeL(TInt aSize);
119 void SetEntryL(const TTime& aTime,TUint aSetAttMask,TUint aClearAttMask);
122 inline void SetHandle(HANDLE aHandle) {iWinHandle=aHandle;}
123 void CheckPosL(TInt64 aPos);
124 static TInt RomAddress(const TDesC& aName, HANDLE aFile, TUint8*& aAddr);
126 // from CFileCB::MExtendedFileInterface
127 virtual void ReadL(TInt64 aPos,TInt& aLength,TDes8* aDes,const RMessagePtr2& aMessage, TInt aOffset);
128 virtual void WriteL(TInt64 aPos,TInt& aLength,const TDesC8* aDes,const RMessagePtr2& aMessage, TInt aOffset);
129 virtual void SetSizeL(TInt64 aSize);
133 virtual TInt GetInterface(TInt aInterfaceId,TAny*& aInterface,TAny* aInput);
136 TBool IsRomDrive() const;
137 inline CLocalMountCB& LocalMount() const {return((CLocalMountCB&)Mount());}
149 class CLocalDirCB : public CDirCB
154 void ReadL(TEntry& anEntry);
155 inline void SetHandle(HANDLE aHandle) {iWinHandle=aHandle;}
156 inline void SetFullName(const TDesC& aName) {iFullName.Set(aName,NULL,NULL);}
170 class CLocalFormatCB : public CFormatCB
176 virtual void DoFormatStepL();
183 class CLocal : public CFileSystem
188 CMountCB* NewMountL() const;
189 CFileCB* NewFileL() const;
190 CDirCB* NewDirL() const;
191 CFormatCB* NewFormatL() const;
192 TInt DefaultPath(TDes& aPath) const;
193 void DriveInfo(TDriveInfo& anInfo,TInt aDriveNumber) const;