First public contribution.
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
21 CFatFileSystem* CFatFileSystem::New()
23 // Create a FatFileSystem
26 CFatFileSystem* fatfsys=new CFatFileSystem();
34 CFatFileSystem::CFatFileSystem() : iUseLocalTimeIfRemovable(EFalse)
36 // Construct the file system
41 CFatFileSystem::~CFatFileSystem()
48 TInt CFatFileSystem::Install()
50 // Install the file system
53 iVersion=TVersion(KF32MajorVersionNumber,KF32MinorVersionNumber,KF32BuildVersionNumber);
55 // Read in setting from the config file to possibly make file server
57 _LIT8(KFatConfigSection, "FatConfig");
58 _LIT8(KLocalTimeIfRemovable, "LocalTimeIfRemovable");
59 F32Properties::GetBool(KFatConfigSection, KLocalTimeIfRemovable, iUseLocalTimeIfRemovable);
61 return(SetName(&KFileSystemName_FAT));
64 CMountCB* CFatFileSystem::NewMountL() const
66 // Create a new mount control block.
70 return(CFatMountCB::NewL());
73 CFileCB* CFatFileSystem::NewFileL() const
79 return(new(ELeave) CFatFileCB());
82 CDirCB* CFatFileSystem::NewDirL() const
84 // Create a new directory lister.
88 return(CFatDirCB::NewL());
91 CFormatCB* CFatFileSystem::NewFormatL() const
93 // Create a new media formatter.
97 return (new(ELeave) CFatFormatCB());
100 TInt CFatFileSystem::DefaultPath(TDes& aPath) const
102 // Return the initial default path.
107 aPath[0] = (TUint8) RFs::GetSystemDriveChar();
112 TBool CFatFileSystem::IsExtensionSupported() const
120 TBool CFatFileSystem::GetUseLocalTime() const
122 return iUseLocalTimeIfRemovable;
125 void CFatFileSystem::SetUseLocalTime(TBool aFlag)
127 iUseLocalTimeIfRemovable = aFlag;
131 Reports whether the specified interface is supported - if it is,
132 the supplied interface object is modified to it
134 @param aInterfaceId The interface of interest
135 @param aInterface The interface object
136 @return KErrNone if the interface is supported, otherwise KErrNotFound
138 @see CFileSystem::GetInterface()
140 TInt CFatFileSystem::GetInterface(TInt aInterfaceId, TAny*& aInterface,TAny* aInput)
144 case CFileSystem::EProxyDriveSupport: // The FAT Filesystem supports proxy drives
148 return(CFileSystem::GetInterface(aInterfaceId, aInterface, aInput));