userlibandfileserver/fileserver/sfat32/sl_fsy.cpp
author Tom Cosgrove <tom.cosgrove@nokia.com>
Fri, 28 May 2010 16:26:05 +0100
branchRCL_3
changeset 136 743008598095
parent 33 0173bcd7697c
child 291 206a6eaaeb71
permissions -rw-r--r--
Fix for bug 2283 (RVCT 4.0 support is missing from PDK 3.0.h) Have multiple extension sections in the bld.inf, one for each version of the compiler. The RVCT version building the tools will build the runtime libraries for its version, but make sure we extract all the other versions from zip archives. Also add the archive for RVCT4.

// Copyright (c) 1996-2009 Nokia Corporation and/or its subsidiary(-ies).
// All rights reserved.
// This component and the accompanying materials are made available
// under the terms of the License "Eclipse Public License v1.0"
// which accompanies this distribution, and is available
// at the URL "http://www.eclipse.org/legal/epl-v10.html".
//
// Initial Contributors:
// Nokia Corporation - initial contribution.
//
// Contributors:
//
// Description:
// f32\sfat\sl_fsy.cpp
// 
//

#include "sl_std.h"
#include <e32hal.h>

CFatFileSystem* CFatFileSystem::New()
//
// Create a FatFileSystem 
//
	{
	CFatFileSystem* fatfsys=new CFatFileSystem();
	if (fatfsys==NULL)
		return(NULL);

	return fatfsys;
	}


CFatFileSystem::CFatFileSystem() : iUseLocalTimeIfRemovable(EFalse)
//
// Construct the file system
//
	{
	}	

CFatFileSystem::~CFatFileSystem()
//
// Destructor
//
	{
	}

TInt CFatFileSystem::Install()
//
// Install the file system
//
	{
	iVersion=TVersion(KF32MajorVersionNumber,KF32MinorVersionNumber,KF32BuildVersionNumber);

	// Read in setting from the config file to possibly make file server 
 	// use local time.
 	_LIT8(KFatConfigSection, "FatConfig");
 	_LIT8(KLocalTimeIfRemovable, "LocalTimeIfRemovable");
 	F32Properties::GetBool(KFatConfigSection, KLocalTimeIfRemovable, iUseLocalTimeIfRemovable);

	return(SetName(&KFileSystemName_FAT));
	}

CMountCB* CFatFileSystem::NewMountL() const
//
// Create a new mount control block.
//
	{

	return(CFatMountCB::NewL());
	}

CFileCB* CFatFileSystem::NewFileL() const
//
// Create a new file.
//
	{

	return(new(ELeave) CFatFileCB());
	}

CDirCB* CFatFileSystem::NewDirL() const
//
// Create a new directory lister.
//
	{

	return(CFatDirCB::NewL());
	}

CFormatCB* CFatFileSystem::NewFormatL() const
//
// Create a new media formatter.
//
	{

	return (new(ELeave) CFatFormatCB());
	}

TInt CFatFileSystem::DefaultPath(TDes& aPath) const
//
// Return the initial default path.
//
	{

	aPath=_L("?:\\");
	aPath[0] = (TUint8) RFs::GetSystemDriveChar();
	return(KErrNone);
	}


TBool CFatFileSystem::IsExtensionSupported() const
//
//
//
	{
	return(ETrue);
	}

TBool CFatFileSystem::GetUseLocalTime() const
	{
	return iUseLocalTimeIfRemovable;
	}

void CFatFileSystem::SetUseLocalTime(TBool aFlag)
	{
	iUseLocalTimeIfRemovable = aFlag;
	}

/**
Reports whether the specified interface is supported - if it is,
the supplied interface object is modified to it

@param aInterfaceId     The interface of interest
@param aInterface       The interface object
@return                 KErrNone if the interface is supported, otherwise KErrNotFound 

@see CFileSystem::GetInterface()
*/
TInt CFatFileSystem::GetInterface(TInt aInterfaceId, TAny*& aInterface,TAny* aInput)
    {
    switch(aInterfaceId)
        {
        case CFileSystem::EProxyDriveSupport: // The FAT Filesystem supports proxy drives
			return KErrNone;

        default:
            return(CFileSystem::GetInterface(aInterfaceId, aInterface, aInput));
        }
    }