os/kernelhwsrv/userlibandfileserver/fileserver/inc/elocal.h
author sl@SLION-WIN7.fritz.box
Fri, 15 Jun 2012 03:10:57 +0200
changeset 0 bde4ae8d615e
permissions -rw-r--r--
First public contribution.
sl@0
     1
// Copyright (c) 1995-2009 Nokia Corporation and/or its subsidiary(-ies).
sl@0
     2
// All rights reserved.
sl@0
     3
// This component and the accompanying materials are made available
sl@0
     4
// under the terms of the License "Eclipse Public License v1.0"
sl@0
     5
// which accompanies this distribution, and is available
sl@0
     6
// at the URL "http://www.eclipse.org/legal/epl-v10.html".
sl@0
     7
//
sl@0
     8
// Initial Contributors:
sl@0
     9
// Nokia Corporation - initial contribution.
sl@0
    10
//
sl@0
    11
// Contributors:
sl@0
    12
//
sl@0
    13
// Description:
sl@0
    14
// f32\inc\elocal.h
sl@0
    15
// 
sl@0
    16
//
sl@0
    17
sl@0
    18
/**
sl@0
    19
 @file f32\inc\elocal.h
sl@0
    20
 @internalTechnology
sl@0
    21
*/
sl@0
    22
sl@0
    23
#if !defined(__ELOCAL_H__)
sl@0
    24
#define __ELOCAL_H__
sl@0
    25
sl@0
    26
#include "common.h"
sl@0
    27
#include <f32file.h>
sl@0
    28
#include <f32fsys.h>
sl@0
    29
#include <f32ver.h>
sl@0
    30
sl@0
    31
#include <e32wins.h>
sl@0
    32
sl@0
    33
#define WIN32_LEAN_AND_MEAN
sl@0
    34
#pragma warning( disable : 4201 ) // nonstandard extension used : nameless struct/union
sl@0
    35
#include <windows.h>
sl@0
    36
#pragma warning( default : 4201 ) // nonstandard extension used : nameless struct/union
sl@0
    37
sl@0
    38
/**
sl@0
    39
@internalTechnology
sl@0
    40
@released
sl@0
    41
*/
sl@0
    42
enum TPanic
sl@0
    43
	{
sl@0
    44
	EFileTimeToSystemTime,
sl@0
    45
	EFileClose,
sl@0
    46
	EFileCloseSetAttributes,
sl@0
    47
	EDirClose,
sl@0
    48
	EMapCouldNotConnect
sl@0
    49
	};
sl@0
    50
sl@0
    51
sl@0
    52
/**
sl@0
    53
@internalTechnology
sl@0
    54
@released
sl@0
    55
*/
sl@0
    56
class CLocalMountCB : public CMountCB, 
sl@0
    57
					  public CMountCB::MFileExtendedInterface
sl@0
    58
	{
sl@0
    59
public:
sl@0
    60
	CLocalMountCB();
sl@0
    61
	~CLocalMountCB();
sl@0
    62
	void MountL(TBool aForceMount);
sl@0
    63
	TInt ReMount();
sl@0
    64
	void Dismounted();
sl@0
    65
	void VolumeL(TVolumeInfo& aVolume) const;
sl@0
    66
	void SetVolumeL(TDes& aName);
sl@0
    67
	void MkDirL(const TDesC& aName);
sl@0
    68
	void RmDirL(const TDesC& aName);
sl@0
    69
	void DeleteL(const TDesC& aName);
sl@0
    70
	void RenameL(const TDesC& anOldName,const TDesC& anNewName);
sl@0
    71
	void ReplaceL(const TDesC& anOldName,const TDesC& anNewName);
sl@0
    72
	void EntryL(const TDesC& aName,TEntry& anEntry) const;
sl@0
    73
	void SetEntryL(const TDesC& aName,const TTime& aTime,TUint aSetAttMask,TUint aClearAttMask);
sl@0
    74
	void FileOpenL(const TDesC& aName,TUint aMode,TFileOpen anOpen,CFileCB* aFile);
sl@0
    75
	void DirOpenL(const TDesC& aName,CDirCB* aDir);
sl@0
    76
	void RawReadL(TInt64 aPos,TInt aLength,const TAny* aDes,TInt anOffset,const RMessagePtr2& aMessage) const;
sl@0
    77
	void RawWriteL(TInt64 aPos,TInt aLength,const TAny* aDes,TInt anOffset,const RMessagePtr2& aMessage);
sl@0
    78
	void ReadUidL(const TDesC& aName,TEntry& anEntry) const;
sl@0
    79
	void GetShortNameL(const TDesC& aLongName,TDes& aShortName);
sl@0
    80
	void GetLongNameL(const TDesC& aShortName,TDes& aLongName);
sl@0
    81
	void IsFileInRom(const TDesC& aFileName,TUint8*& aFileStart);
sl@0
    82
	void ReadSectionL(const TDesC& aName,TInt aPos,TAny* aTrg,TInt aLength, const RMessagePtr2& aMessage);
sl@0
    83
	TInt LocalBufferSupport();
sl@0
    84
    TInt MountControl(TInt aLevel, TInt aOption, TAny* aParam);
sl@0
    85
    
sl@0
    86
    // interface extension implementation
sl@0
    87
	virtual void ReadSection64L(const TDesC& aName, TInt64 aPos, TAny* aTrg, TInt aLength, const RMessagePtr2& aMessage);
sl@0
    88
sl@0
    89
sl@0
    90
    inline TUint64 MaxFileSizeSupported() const {return iMaxFileSizeSupported;}
sl@0
    91
sl@0
    92
protected:
sl@0
    93
	virtual TInt GetInterface(TInt aInterfaceId,TAny*& aInterface,TAny* aInput);
sl@0
    94
private:
sl@0
    95
	TBool IsRomDrive() const;
sl@0
    96
sl@0
    97
sl@0
    98
sl@0
    99
private:
sl@0
   100
sl@0
   101
    TUint64 iMaxFileSizeSupported;  ///< Max. file size supported by HOST filesystem (4G-1 for FAT, 17,592,185,978,880 bytes for NTFS)
sl@0
   102
sl@0
   103
	};
sl@0
   104
sl@0
   105
/**
sl@0
   106
@internalTechnology
sl@0
   107
@released
sl@0
   108
*/
sl@0
   109
class CLocalFileCB : public CFileCB, public CFileCB::MExtendedFileInterface
sl@0
   110
	{
sl@0
   111
public:
sl@0
   112
	CLocalFileCB();
sl@0
   113
	~CLocalFileCB();
sl@0
   114
	void RenameL(const TDesC& aNewName);
sl@0
   115
	void ReadL(TInt aPos,TInt& aLength,const TAny* aDes,const RMessagePtr2& aMessage);
sl@0
   116
	void WriteL(TInt aPos,TInt& aLength,const TAny* aDes,const RMessagePtr2& aMessage);
sl@0
   117
	TInt Address(TInt& aPos) const;
sl@0
   118
	void SetSizeL(TInt aSize);
sl@0
   119
	void SetEntryL(const TTime& aTime,TUint aSetAttMask,TUint aClearAttMask);
sl@0
   120
	void FlushDataL();
sl@0
   121
	void FlushAllL();
sl@0
   122
	inline void SetHandle(HANDLE aHandle) {iWinHandle=aHandle;}
sl@0
   123
	void CheckPosL(TInt64 aPos);
sl@0
   124
	static TInt RomAddress(const TDesC& aName, HANDLE aFile, TUint8*& aAddr);
sl@0
   125
	
sl@0
   126
	// from CFileCB::MExtendedFileInterface
sl@0
   127
	virtual void ReadL(TInt64 aPos,TInt& aLength,TDes8* aDes,const RMessagePtr2& aMessage, TInt aOffset);
sl@0
   128
	virtual void WriteL(TInt64 aPos,TInt& aLength,const TDesC8* aDes,const RMessagePtr2& aMessage, TInt aOffset);
sl@0
   129
	virtual void SetSizeL(TInt64 aSize);
sl@0
   130
sl@0
   131
protected:
sl@0
   132
	// from CFileCB
sl@0
   133
	virtual TInt GetInterface(TInt aInterfaceId,TAny*& aInterface,TAny* aInput);
sl@0
   134
sl@0
   135
private:
sl@0
   136
	TBool IsRomDrive() const;
sl@0
   137
    inline CLocalMountCB& LocalMount() const {return((CLocalMountCB&)Mount());}
sl@0
   138
sl@0
   139
private:
sl@0
   140
	TInt64 iCurrentPos;
sl@0
   141
	TUint8* iFilePtr;
sl@0
   142
	HANDLE iWinHandle;
sl@0
   143
	};
sl@0
   144
sl@0
   145
/**
sl@0
   146
@internalTechnology
sl@0
   147
@released
sl@0
   148
*/
sl@0
   149
class CLocalDirCB : public CDirCB
sl@0
   150
	{
sl@0
   151
public:
sl@0
   152
	CLocalDirCB();
sl@0
   153
	~CLocalDirCB();
sl@0
   154
	void ReadL(TEntry& anEntry);
sl@0
   155
	inline void SetHandle(HANDLE aHandle) {iWinHandle=aHandle;}
sl@0
   156
	inline void SetFullName(const TDesC& aName) {iFullName.Set(aName,NULL,NULL);}
sl@0
   157
private:
sl@0
   158
	TBool MatchUid();
sl@0
   159
public:
sl@0
   160
	TEntry iEntry;
sl@0
   161
private:
sl@0
   162
	HANDLE iWinHandle;
sl@0
   163
	TParse iFullName;
sl@0
   164
	};
sl@0
   165
sl@0
   166
/**
sl@0
   167
@internalTechnology
sl@0
   168
@released
sl@0
   169
*/
sl@0
   170
class CLocalFormatCB : public CFormatCB
sl@0
   171
	{
sl@0
   172
public:
sl@0
   173
	CLocalFormatCB();
sl@0
   174
	~CLocalFormatCB();
sl@0
   175
public:
sl@0
   176
	virtual void DoFormatStepL();
sl@0
   177
	};
sl@0
   178
sl@0
   179
/**
sl@0
   180
@internalTechnology
sl@0
   181
@released
sl@0
   182
*/
sl@0
   183
class CLocal : public CFileSystem
sl@0
   184
	{
sl@0
   185
public:
sl@0
   186
	CLocal();
sl@0
   187
	TInt Install();
sl@0
   188
	CMountCB* NewMountL() const;
sl@0
   189
	CFileCB* NewFileL() const;
sl@0
   190
	CDirCB* NewDirL() const;
sl@0
   191
	CFormatCB* NewFormatL() const;
sl@0
   192
	TInt DefaultPath(TDes& aPath) const;
sl@0
   193
	void DriveInfo(TDriveInfo& anInfo,TInt aDriveNumber) const;
sl@0
   194
	};
sl@0
   195
sl@0
   196
sl@0
   197
#endif
sl@0
   198
sl@0
   199