Update contrib.
1 // Copyright (c) 1996-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.
14 // f32\sfat\sl_fsy.cpp
18 //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
19 //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
21 //!! WARNING!! DO NOT edit this file !! '\sfat' component is obsolete and is not being used. '\sfat32'replaces it
23 //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
24 //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
29 CFatFileSystem* CFatFileSystem::New()
31 // Create a FatFileSystem
34 CFatFileSystem* fatfsys=new CFatFileSystem();
42 CFatFileSystem::CFatFileSystem() : iUseLocalTimeIfRemovable(EFalse)
44 // Construct the file system
49 CFatFileSystem::~CFatFileSystem()
56 TInt CFatFileSystem::Install()
58 // Install the file system
61 iVersion=TVersion(KF32MajorVersionNumber,KF32MinorVersionNumber,KF32BuildVersionNumber);
63 // Read in setting from the config file to possibly make file server
65 _LIT8(KFatConfigSection, "FatConfig");
66 _LIT8(KLocalTimeIfRemovable, "LocalTimeIfRemovable");
67 F32Properties::GetBool(KFatConfigSection, KLocalTimeIfRemovable, iUseLocalTimeIfRemovable);
69 return(SetName(&KFileSystemName_FAT));
72 CMountCB* CFatFileSystem::NewMountL() const
74 // Create a new mount control block.
78 return(CFatMountCB::NewL());
81 CFileCB* CFatFileSystem::NewFileL() const
87 return(new(ELeave) CFatFileCB());
90 CDirCB* CFatFileSystem::NewDirL() const
92 // Create a new directory lister.
96 return(CFatDirCB::NewL());
99 CFormatCB* CFatFileSystem::NewFormatL() const
101 // Create a new media formatter.
105 return (new(ELeave) CFatFormatCB());
108 TInt CFatFileSystem::DefaultPath(TDes& aPath) const
110 // Return the initial default path.
115 aPath[0] = (TUint8) RFs::GetSystemDriveChar();
120 void CFatFileSystem::DriveInfo(TDriveInfo& anInfo,TInt aDriveNumber) const
122 // Return the drive info. iBatteryState are already set.
126 if(!IsValidLocalDriveMapping(aDriveNumber))
129 TLocalDriveCapsV2Buf localDriveCaps;
133 // is the drive local?
134 if (!IsProxyDrive(aDriveNumber))
136 // if not valid local drive, use default values in localDriveCaps
137 // if valid local drive and not locked, use TBusLocalDrive::Caps() values
138 // if valid drive and locked, hard-code attributes
139 r = GetLocalDrive(aDriveNumber).Caps(localDriveCaps);
141 else // this need to be made a bit nicer
143 CExtProxyDrive* pD = GetProxyDrive(aDriveNumber);
145 r = pD->Caps(localDriveCaps);
147 r = KErrNotReady; // What should the behaviour really be here?
150 if (r != KErrLocked )
152 anInfo.iMediaAtt=localDriveCaps().iMediaAtt;
156 anInfo.iMediaAtt = KMediaAttLocked | KMediaAttLockable | KMediaAttHasPassword;
159 anInfo.iType=localDriveCaps().iType;
160 anInfo.iDriveAtt=localDriveCaps().iDriveAtt;
164 TBool CFatFileSystem::IsExtensionSupported() const
172 TBool CFatFileSystem::GetUseLocalTime() const
174 return iUseLocalTimeIfRemovable;
177 void CFatFileSystem::SetUseLocalTime(TBool aFlag)
179 iUseLocalTimeIfRemovable = aFlag;
183 Reports whether the specified interface is supported - if it is,
184 the supplied interface object is modified to it
186 @param aInterfaceId The interface of interest
187 @param aInterface The interface object
188 @return KErrNone if the interface is supported, otherwise KErrNotFound
190 @see CFileSystem::GetInterface()
192 TInt CFatFileSystem::GetInterface(TInt aInterfaceId, TAny*& aInterface,TAny* aInput)
196 case CFileSystem::EProxyDriveSupport: // The FAT Filesystem supports proxy drives
200 return(CFileSystem::GetInterface(aInterfaceId, aInterface, aInput));