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