os/kernelhwsrv/userlibandfileserver/fileserver/sfat32/sl_fsy.cpp
author sl@SLION-WIN7.fritz.box
Fri, 15 Jun 2012 03:10:57 +0200
changeset 0 bde4ae8d615e
permissions -rw-r--r--
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".
     7 //
     8 // Initial Contributors:
     9 // Nokia Corporation - initial contribution.
    10 //
    11 // Contributors:
    12 //
    13 // Description:
    14 // f32\sfat\sl_fsy.cpp
    15 // 
    16 //
    17 
    18 #include "sl_std.h"
    19 #include <e32hal.h>
    20 
    21 CFatFileSystem* CFatFileSystem::New()
    22 //
    23 // Create a FatFileSystem 
    24 //
    25 	{
    26 	CFatFileSystem* fatfsys=new CFatFileSystem();
    27 	if (fatfsys==NULL)
    28 		return(NULL);
    29 
    30 	return fatfsys;
    31 	}
    32 
    33 
    34 CFatFileSystem::CFatFileSystem() : iUseLocalTimeIfRemovable(EFalse)
    35 //
    36 // Construct the file system
    37 //
    38 	{
    39 	}	
    40 
    41 CFatFileSystem::~CFatFileSystem()
    42 //
    43 // Destructor
    44 //
    45 	{
    46 	}
    47 
    48 TInt CFatFileSystem::Install()
    49 //
    50 // Install the file system
    51 //
    52 	{
    53 	iVersion=TVersion(KF32MajorVersionNumber,KF32MinorVersionNumber,KF32BuildVersionNumber);
    54 
    55 	// Read in setting from the config file to possibly make file server 
    56  	// use local time.
    57  	_LIT8(KFatConfigSection, "FatConfig");
    58  	_LIT8(KLocalTimeIfRemovable, "LocalTimeIfRemovable");
    59  	F32Properties::GetBool(KFatConfigSection, KLocalTimeIfRemovable, iUseLocalTimeIfRemovable);
    60 
    61 	return(SetName(&KFileSystemName_FAT));
    62 	}
    63 
    64 CMountCB* CFatFileSystem::NewMountL() const
    65 //
    66 // Create a new mount control block.
    67 //
    68 	{
    69 
    70 	return(CFatMountCB::NewL());
    71 	}
    72 
    73 CFileCB* CFatFileSystem::NewFileL() const
    74 //
    75 // Create a new file.
    76 //
    77 	{
    78 
    79 	return(new(ELeave) CFatFileCB());
    80 	}
    81 
    82 CDirCB* CFatFileSystem::NewDirL() const
    83 //
    84 // Create a new directory lister.
    85 //
    86 	{
    87 
    88 	return(CFatDirCB::NewL());
    89 	}
    90 
    91 CFormatCB* CFatFileSystem::NewFormatL() const
    92 //
    93 // Create a new media formatter.
    94 //
    95 	{
    96 
    97 	return (new(ELeave) CFatFormatCB());
    98 	}
    99 
   100 TInt CFatFileSystem::DefaultPath(TDes& aPath) const
   101 //
   102 // Return the initial default path.
   103 //
   104 	{
   105 
   106 	aPath=_L("?:\\");
   107 	aPath[0] = (TUint8) RFs::GetSystemDriveChar();
   108 	return(KErrNone);
   109 	}
   110 
   111 
   112 TBool CFatFileSystem::IsExtensionSupported() const
   113 //
   114 //
   115 //
   116 	{
   117 	return(ETrue);
   118 	}
   119 
   120 TBool CFatFileSystem::GetUseLocalTime() const
   121 	{
   122 	return iUseLocalTimeIfRemovable;
   123 	}
   124 
   125 void CFatFileSystem::SetUseLocalTime(TBool aFlag)
   126 	{
   127 	iUseLocalTimeIfRemovable = aFlag;
   128 	}
   129 
   130 /**
   131 Reports whether the specified interface is supported - if it is,
   132 the supplied interface object is modified to it
   133 
   134 @param aInterfaceId     The interface of interest
   135 @param aInterface       The interface object
   136 @return                 KErrNone if the interface is supported, otherwise KErrNotFound 
   137 
   138 @see CFileSystem::GetInterface()
   139 */
   140 TInt CFatFileSystem::GetInterface(TInt aInterfaceId, TAny*& aInterface,TAny* aInput)
   141     {
   142     switch(aInterfaceId)
   143         {
   144         case CFileSystem::EProxyDriveSupport: // The FAT Filesystem supports proxy drives
   145 			return KErrNone;
   146 
   147         default:
   148             return(CFileSystem::GetInterface(aInterfaceId, aInterface, aInput));
   149         }
   150     }