1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/os/kernelhwsrv/userlibandfileserver/fileserver/inc/elocal.h Fri Jun 15 03:10:57 2012 +0200
1.3 @@ -0,0 +1,199 @@
1.4 +// Copyright (c) 1995-2009 Nokia Corporation and/or its subsidiary(-ies).
1.5 +// All rights reserved.
1.6 +// This component and the accompanying materials are made available
1.7 +// under the terms of the License "Eclipse Public License v1.0"
1.8 +// which accompanies this distribution, and is available
1.9 +// at the URL "http://www.eclipse.org/legal/epl-v10.html".
1.10 +//
1.11 +// Initial Contributors:
1.12 +// Nokia Corporation - initial contribution.
1.13 +//
1.14 +// Contributors:
1.15 +//
1.16 +// Description:
1.17 +// f32\inc\elocal.h
1.18 +//
1.19 +//
1.20 +
1.21 +/**
1.22 + @file f32\inc\elocal.h
1.23 + @internalTechnology
1.24 +*/
1.25 +
1.26 +#if !defined(__ELOCAL_H__)
1.27 +#define __ELOCAL_H__
1.28 +
1.29 +#include "common.h"
1.30 +#include <f32file.h>
1.31 +#include <f32fsys.h>
1.32 +#include <f32ver.h>
1.33 +
1.34 +#include <e32wins.h>
1.35 +
1.36 +#define WIN32_LEAN_AND_MEAN
1.37 +#pragma warning( disable : 4201 ) // nonstandard extension used : nameless struct/union
1.38 +#include <windows.h>
1.39 +#pragma warning( default : 4201 ) // nonstandard extension used : nameless struct/union
1.40 +
1.41 +/**
1.42 +@internalTechnology
1.43 +@released
1.44 +*/
1.45 +enum TPanic
1.46 + {
1.47 + EFileTimeToSystemTime,
1.48 + EFileClose,
1.49 + EFileCloseSetAttributes,
1.50 + EDirClose,
1.51 + EMapCouldNotConnect
1.52 + };
1.53 +
1.54 +
1.55 +/**
1.56 +@internalTechnology
1.57 +@released
1.58 +*/
1.59 +class CLocalMountCB : public CMountCB,
1.60 + public CMountCB::MFileExtendedInterface
1.61 + {
1.62 +public:
1.63 + CLocalMountCB();
1.64 + ~CLocalMountCB();
1.65 + void MountL(TBool aForceMount);
1.66 + TInt ReMount();
1.67 + void Dismounted();
1.68 + void VolumeL(TVolumeInfo& aVolume) const;
1.69 + void SetVolumeL(TDes& aName);
1.70 + void MkDirL(const TDesC& aName);
1.71 + void RmDirL(const TDesC& aName);
1.72 + void DeleteL(const TDesC& aName);
1.73 + void RenameL(const TDesC& anOldName,const TDesC& anNewName);
1.74 + void ReplaceL(const TDesC& anOldName,const TDesC& anNewName);
1.75 + void EntryL(const TDesC& aName,TEntry& anEntry) const;
1.76 + void SetEntryL(const TDesC& aName,const TTime& aTime,TUint aSetAttMask,TUint aClearAttMask);
1.77 + void FileOpenL(const TDesC& aName,TUint aMode,TFileOpen anOpen,CFileCB* aFile);
1.78 + void DirOpenL(const TDesC& aName,CDirCB* aDir);
1.79 + void RawReadL(TInt64 aPos,TInt aLength,const TAny* aDes,TInt anOffset,const RMessagePtr2& aMessage) const;
1.80 + void RawWriteL(TInt64 aPos,TInt aLength,const TAny* aDes,TInt anOffset,const RMessagePtr2& aMessage);
1.81 + void ReadUidL(const TDesC& aName,TEntry& anEntry) const;
1.82 + void GetShortNameL(const TDesC& aLongName,TDes& aShortName);
1.83 + void GetLongNameL(const TDesC& aShortName,TDes& aLongName);
1.84 + void IsFileInRom(const TDesC& aFileName,TUint8*& aFileStart);
1.85 + void ReadSectionL(const TDesC& aName,TInt aPos,TAny* aTrg,TInt aLength, const RMessagePtr2& aMessage);
1.86 + TInt LocalBufferSupport();
1.87 + TInt MountControl(TInt aLevel, TInt aOption, TAny* aParam);
1.88 +
1.89 + // interface extension implementation
1.90 + virtual void ReadSection64L(const TDesC& aName, TInt64 aPos, TAny* aTrg, TInt aLength, const RMessagePtr2& aMessage);
1.91 +
1.92 +
1.93 + inline TUint64 MaxFileSizeSupported() const {return iMaxFileSizeSupported;}
1.94 +
1.95 +protected:
1.96 + virtual TInt GetInterface(TInt aInterfaceId,TAny*& aInterface,TAny* aInput);
1.97 +private:
1.98 + TBool IsRomDrive() const;
1.99 +
1.100 +
1.101 +
1.102 +private:
1.103 +
1.104 + TUint64 iMaxFileSizeSupported; ///< Max. file size supported by HOST filesystem (4G-1 for FAT, 17,592,185,978,880 bytes for NTFS)
1.105 +
1.106 + };
1.107 +
1.108 +/**
1.109 +@internalTechnology
1.110 +@released
1.111 +*/
1.112 +class CLocalFileCB : public CFileCB, public CFileCB::MExtendedFileInterface
1.113 + {
1.114 +public:
1.115 + CLocalFileCB();
1.116 + ~CLocalFileCB();
1.117 + void RenameL(const TDesC& aNewName);
1.118 + void ReadL(TInt aPos,TInt& aLength,const TAny* aDes,const RMessagePtr2& aMessage);
1.119 + void WriteL(TInt aPos,TInt& aLength,const TAny* aDes,const RMessagePtr2& aMessage);
1.120 + TInt Address(TInt& aPos) const;
1.121 + void SetSizeL(TInt aSize);
1.122 + void SetEntryL(const TTime& aTime,TUint aSetAttMask,TUint aClearAttMask);
1.123 + void FlushDataL();
1.124 + void FlushAllL();
1.125 + inline void SetHandle(HANDLE aHandle) {iWinHandle=aHandle;}
1.126 + void CheckPosL(TInt64 aPos);
1.127 + static TInt RomAddress(const TDesC& aName, HANDLE aFile, TUint8*& aAddr);
1.128 +
1.129 + // from CFileCB::MExtendedFileInterface
1.130 + virtual void ReadL(TInt64 aPos,TInt& aLength,TDes8* aDes,const RMessagePtr2& aMessage, TInt aOffset);
1.131 + virtual void WriteL(TInt64 aPos,TInt& aLength,const TDesC8* aDes,const RMessagePtr2& aMessage, TInt aOffset);
1.132 + virtual void SetSizeL(TInt64 aSize);
1.133 +
1.134 +protected:
1.135 + // from CFileCB
1.136 + virtual TInt GetInterface(TInt aInterfaceId,TAny*& aInterface,TAny* aInput);
1.137 +
1.138 +private:
1.139 + TBool IsRomDrive() const;
1.140 + inline CLocalMountCB& LocalMount() const {return((CLocalMountCB&)Mount());}
1.141 +
1.142 +private:
1.143 + TInt64 iCurrentPos;
1.144 + TUint8* iFilePtr;
1.145 + HANDLE iWinHandle;
1.146 + };
1.147 +
1.148 +/**
1.149 +@internalTechnology
1.150 +@released
1.151 +*/
1.152 +class CLocalDirCB : public CDirCB
1.153 + {
1.154 +public:
1.155 + CLocalDirCB();
1.156 + ~CLocalDirCB();
1.157 + void ReadL(TEntry& anEntry);
1.158 + inline void SetHandle(HANDLE aHandle) {iWinHandle=aHandle;}
1.159 + inline void SetFullName(const TDesC& aName) {iFullName.Set(aName,NULL,NULL);}
1.160 +private:
1.161 + TBool MatchUid();
1.162 +public:
1.163 + TEntry iEntry;
1.164 +private:
1.165 + HANDLE iWinHandle;
1.166 + TParse iFullName;
1.167 + };
1.168 +
1.169 +/**
1.170 +@internalTechnology
1.171 +@released
1.172 +*/
1.173 +class CLocalFormatCB : public CFormatCB
1.174 + {
1.175 +public:
1.176 + CLocalFormatCB();
1.177 + ~CLocalFormatCB();
1.178 +public:
1.179 + virtual void DoFormatStepL();
1.180 + };
1.181 +
1.182 +/**
1.183 +@internalTechnology
1.184 +@released
1.185 +*/
1.186 +class CLocal : public CFileSystem
1.187 + {
1.188 +public:
1.189 + CLocal();
1.190 + TInt Install();
1.191 + CMountCB* NewMountL() const;
1.192 + CFileCB* NewFileL() const;
1.193 + CDirCB* NewDirL() const;
1.194 + CFormatCB* NewFormatL() const;
1.195 + TInt DefaultPath(TDes& aPath) const;
1.196 + void DriveInfo(TDriveInfo& anInfo,TInt aDriveNumber) const;
1.197 + };
1.198 +
1.199 +
1.200 +#endif
1.201 +
1.202 +