sl@0: // Copyright (c) 1995-2009 Nokia Corporation and/or its subsidiary(-ies). sl@0: // All rights reserved. sl@0: // This component and the accompanying materials are made available sl@0: // under the terms of the License "Eclipse Public License v1.0" sl@0: // which accompanies this distribution, and is available sl@0: // at the URL "http://www.eclipse.org/legal/epl-v10.html". sl@0: // sl@0: // Initial Contributors: sl@0: // Nokia Corporation - initial contribution. sl@0: // sl@0: // Contributors: sl@0: // sl@0: // Description: sl@0: // f32\inc\elocal.h sl@0: // sl@0: // sl@0: sl@0: /** sl@0: @file f32\inc\elocal.h sl@0: @internalTechnology sl@0: */ sl@0: sl@0: #if !defined(__ELOCAL_H__) sl@0: #define __ELOCAL_H__ sl@0: sl@0: #include "common.h" sl@0: #include sl@0: #include sl@0: #include sl@0: sl@0: #include sl@0: sl@0: #define WIN32_LEAN_AND_MEAN sl@0: #pragma warning( disable : 4201 ) // nonstandard extension used : nameless struct/union sl@0: #include sl@0: #pragma warning( default : 4201 ) // nonstandard extension used : nameless struct/union sl@0: sl@0: /** sl@0: @internalTechnology sl@0: @released sl@0: */ sl@0: enum TPanic sl@0: { sl@0: EFileTimeToSystemTime, sl@0: EFileClose, sl@0: EFileCloseSetAttributes, sl@0: EDirClose, sl@0: EMapCouldNotConnect sl@0: }; sl@0: sl@0: sl@0: /** sl@0: @internalTechnology sl@0: @released sl@0: */ sl@0: class CLocalMountCB : public CMountCB, sl@0: public CMountCB::MFileExtendedInterface sl@0: { sl@0: public: sl@0: CLocalMountCB(); sl@0: ~CLocalMountCB(); sl@0: void MountL(TBool aForceMount); sl@0: TInt ReMount(); sl@0: void Dismounted(); sl@0: void VolumeL(TVolumeInfo& aVolume) const; sl@0: void SetVolumeL(TDes& aName); sl@0: void MkDirL(const TDesC& aName); sl@0: void RmDirL(const TDesC& aName); sl@0: void DeleteL(const TDesC& aName); sl@0: void RenameL(const TDesC& anOldName,const TDesC& anNewName); sl@0: void ReplaceL(const TDesC& anOldName,const TDesC& anNewName); sl@0: void EntryL(const TDesC& aName,TEntry& anEntry) const; sl@0: void SetEntryL(const TDesC& aName,const TTime& aTime,TUint aSetAttMask,TUint aClearAttMask); sl@0: void FileOpenL(const TDesC& aName,TUint aMode,TFileOpen anOpen,CFileCB* aFile); sl@0: void DirOpenL(const TDesC& aName,CDirCB* aDir); sl@0: void RawReadL(TInt64 aPos,TInt aLength,const TAny* aDes,TInt anOffset,const RMessagePtr2& aMessage) const; sl@0: void RawWriteL(TInt64 aPos,TInt aLength,const TAny* aDes,TInt anOffset,const RMessagePtr2& aMessage); sl@0: void ReadUidL(const TDesC& aName,TEntry& anEntry) const; sl@0: void GetShortNameL(const TDesC& aLongName,TDes& aShortName); sl@0: void GetLongNameL(const TDesC& aShortName,TDes& aLongName); sl@0: void IsFileInRom(const TDesC& aFileName,TUint8*& aFileStart); sl@0: void ReadSectionL(const TDesC& aName,TInt aPos,TAny* aTrg,TInt aLength, const RMessagePtr2& aMessage); sl@0: TInt LocalBufferSupport(); sl@0: TInt MountControl(TInt aLevel, TInt aOption, TAny* aParam); sl@0: sl@0: // interface extension implementation sl@0: virtual void ReadSection64L(const TDesC& aName, TInt64 aPos, TAny* aTrg, TInt aLength, const RMessagePtr2& aMessage); sl@0: sl@0: sl@0: inline TUint64 MaxFileSizeSupported() const {return iMaxFileSizeSupported;} sl@0: sl@0: protected: sl@0: virtual TInt GetInterface(TInt aInterfaceId,TAny*& aInterface,TAny* aInput); sl@0: private: sl@0: TBool IsRomDrive() const; sl@0: sl@0: sl@0: sl@0: private: sl@0: sl@0: TUint64 iMaxFileSizeSupported; ///< Max. file size supported by HOST filesystem (4G-1 for FAT, 17,592,185,978,880 bytes for NTFS) sl@0: sl@0: }; sl@0: sl@0: /** sl@0: @internalTechnology sl@0: @released sl@0: */ sl@0: class CLocalFileCB : public CFileCB, public CFileCB::MExtendedFileInterface sl@0: { sl@0: public: sl@0: CLocalFileCB(); sl@0: ~CLocalFileCB(); sl@0: void RenameL(const TDesC& aNewName); sl@0: void ReadL(TInt aPos,TInt& aLength,const TAny* aDes,const RMessagePtr2& aMessage); sl@0: void WriteL(TInt aPos,TInt& aLength,const TAny* aDes,const RMessagePtr2& aMessage); sl@0: TInt Address(TInt& aPos) const; sl@0: void SetSizeL(TInt aSize); sl@0: void SetEntryL(const TTime& aTime,TUint aSetAttMask,TUint aClearAttMask); sl@0: void FlushDataL(); sl@0: void FlushAllL(); sl@0: inline void SetHandle(HANDLE aHandle) {iWinHandle=aHandle;} sl@0: void CheckPosL(TInt64 aPos); sl@0: static TInt RomAddress(const TDesC& aName, HANDLE aFile, TUint8*& aAddr); sl@0: sl@0: // from CFileCB::MExtendedFileInterface sl@0: virtual void ReadL(TInt64 aPos,TInt& aLength,TDes8* aDes,const RMessagePtr2& aMessage, TInt aOffset); sl@0: virtual void WriteL(TInt64 aPos,TInt& aLength,const TDesC8* aDes,const RMessagePtr2& aMessage, TInt aOffset); sl@0: virtual void SetSizeL(TInt64 aSize); sl@0: sl@0: protected: sl@0: // from CFileCB sl@0: virtual TInt GetInterface(TInt aInterfaceId,TAny*& aInterface,TAny* aInput); sl@0: sl@0: private: sl@0: TBool IsRomDrive() const; sl@0: inline CLocalMountCB& LocalMount() const {return((CLocalMountCB&)Mount());} sl@0: sl@0: private: sl@0: TInt64 iCurrentPos; sl@0: TUint8* iFilePtr; sl@0: HANDLE iWinHandle; sl@0: }; sl@0: sl@0: /** sl@0: @internalTechnology sl@0: @released sl@0: */ sl@0: class CLocalDirCB : public CDirCB sl@0: { sl@0: public: sl@0: CLocalDirCB(); sl@0: ~CLocalDirCB(); sl@0: void ReadL(TEntry& anEntry); sl@0: inline void SetHandle(HANDLE aHandle) {iWinHandle=aHandle;} sl@0: inline void SetFullName(const TDesC& aName) {iFullName.Set(aName,NULL,NULL);} sl@0: private: sl@0: TBool MatchUid(); sl@0: public: sl@0: TEntry iEntry; sl@0: private: sl@0: HANDLE iWinHandle; sl@0: TParse iFullName; sl@0: }; sl@0: sl@0: /** sl@0: @internalTechnology sl@0: @released sl@0: */ sl@0: class CLocalFormatCB : public CFormatCB sl@0: { sl@0: public: sl@0: CLocalFormatCB(); sl@0: ~CLocalFormatCB(); sl@0: public: sl@0: virtual void DoFormatStepL(); sl@0: }; sl@0: sl@0: /** sl@0: @internalTechnology sl@0: @released sl@0: */ sl@0: class CLocal : public CFileSystem sl@0: { sl@0: public: sl@0: CLocal(); sl@0: TInt Install(); sl@0: CMountCB* NewMountL() const; sl@0: CFileCB* NewFileL() const; sl@0: CDirCB* NewDirL() const; sl@0: CFormatCB* NewFormatL() const; sl@0: TInt DefaultPath(TDes& aPath) const; sl@0: void DriveInfo(TDriveInfo& anInfo,TInt aDriveNumber) const; sl@0: }; sl@0: sl@0: sl@0: #endif sl@0: sl@0: