os/kernelhwsrv/userlibandfileserver/fileserver/sfat32/sl_fsy.cpp
changeset 0 bde4ae8d615e
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/os/kernelhwsrv/userlibandfileserver/fileserver/sfat32/sl_fsy.cpp	Fri Jun 15 03:10:57 2012 +0200
     1.3 @@ -0,0 +1,150 @@
     1.4 +// Copyright (c) 1996-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\sfat\sl_fsy.cpp
    1.18 +// 
    1.19 +//
    1.20 +
    1.21 +#include "sl_std.h"
    1.22 +#include <e32hal.h>
    1.23 +
    1.24 +CFatFileSystem* CFatFileSystem::New()
    1.25 +//
    1.26 +// Create a FatFileSystem 
    1.27 +//
    1.28 +	{
    1.29 +	CFatFileSystem* fatfsys=new CFatFileSystem();
    1.30 +	if (fatfsys==NULL)
    1.31 +		return(NULL);
    1.32 +
    1.33 +	return fatfsys;
    1.34 +	}
    1.35 +
    1.36 +
    1.37 +CFatFileSystem::CFatFileSystem() : iUseLocalTimeIfRemovable(EFalse)
    1.38 +//
    1.39 +// Construct the file system
    1.40 +//
    1.41 +	{
    1.42 +	}	
    1.43 +
    1.44 +CFatFileSystem::~CFatFileSystem()
    1.45 +//
    1.46 +// Destructor
    1.47 +//
    1.48 +	{
    1.49 +	}
    1.50 +
    1.51 +TInt CFatFileSystem::Install()
    1.52 +//
    1.53 +// Install the file system
    1.54 +//
    1.55 +	{
    1.56 +	iVersion=TVersion(KF32MajorVersionNumber,KF32MinorVersionNumber,KF32BuildVersionNumber);
    1.57 +
    1.58 +	// Read in setting from the config file to possibly make file server 
    1.59 + 	// use local time.
    1.60 + 	_LIT8(KFatConfigSection, "FatConfig");
    1.61 + 	_LIT8(KLocalTimeIfRemovable, "LocalTimeIfRemovable");
    1.62 + 	F32Properties::GetBool(KFatConfigSection, KLocalTimeIfRemovable, iUseLocalTimeIfRemovable);
    1.63 +
    1.64 +	return(SetName(&KFileSystemName_FAT));
    1.65 +	}
    1.66 +
    1.67 +CMountCB* CFatFileSystem::NewMountL() const
    1.68 +//
    1.69 +// Create a new mount control block.
    1.70 +//
    1.71 +	{
    1.72 +
    1.73 +	return(CFatMountCB::NewL());
    1.74 +	}
    1.75 +
    1.76 +CFileCB* CFatFileSystem::NewFileL() const
    1.77 +//
    1.78 +// Create a new file.
    1.79 +//
    1.80 +	{
    1.81 +
    1.82 +	return(new(ELeave) CFatFileCB());
    1.83 +	}
    1.84 +
    1.85 +CDirCB* CFatFileSystem::NewDirL() const
    1.86 +//
    1.87 +// Create a new directory lister.
    1.88 +//
    1.89 +	{
    1.90 +
    1.91 +	return(CFatDirCB::NewL());
    1.92 +	}
    1.93 +
    1.94 +CFormatCB* CFatFileSystem::NewFormatL() const
    1.95 +//
    1.96 +// Create a new media formatter.
    1.97 +//
    1.98 +	{
    1.99 +
   1.100 +	return (new(ELeave) CFatFormatCB());
   1.101 +	}
   1.102 +
   1.103 +TInt CFatFileSystem::DefaultPath(TDes& aPath) const
   1.104 +//
   1.105 +// Return the initial default path.
   1.106 +//
   1.107 +	{
   1.108 +
   1.109 +	aPath=_L("?:\\");
   1.110 +	aPath[0] = (TUint8) RFs::GetSystemDriveChar();
   1.111 +	return(KErrNone);
   1.112 +	}
   1.113 +
   1.114 +
   1.115 +TBool CFatFileSystem::IsExtensionSupported() const
   1.116 +//
   1.117 +//
   1.118 +//
   1.119 +	{
   1.120 +	return(ETrue);
   1.121 +	}
   1.122 +
   1.123 +TBool CFatFileSystem::GetUseLocalTime() const
   1.124 +	{
   1.125 +	return iUseLocalTimeIfRemovable;
   1.126 +	}
   1.127 +
   1.128 +void CFatFileSystem::SetUseLocalTime(TBool aFlag)
   1.129 +	{
   1.130 +	iUseLocalTimeIfRemovable = aFlag;
   1.131 +	}
   1.132 +
   1.133 +/**
   1.134 +Reports whether the specified interface is supported - if it is,
   1.135 +the supplied interface object is modified to it
   1.136 +
   1.137 +@param aInterfaceId     The interface of interest
   1.138 +@param aInterface       The interface object
   1.139 +@return                 KErrNone if the interface is supported, otherwise KErrNotFound 
   1.140 +
   1.141 +@see CFileSystem::GetInterface()
   1.142 +*/
   1.143 +TInt CFatFileSystem::GetInterface(TInt aInterfaceId, TAny*& aInterface,TAny* aInput)
   1.144 +    {
   1.145 +    switch(aInterfaceId)
   1.146 +        {
   1.147 +        case CFileSystem::EProxyDriveSupport: // The FAT Filesystem supports proxy drives
   1.148 +			return KErrNone;
   1.149 +
   1.150 +        default:
   1.151 +            return(CFileSystem::GetInterface(aInterfaceId, aInterface, aInput));
   1.152 +        }
   1.153 +    }