1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/os/kernelhwsrv/baseapitest/basesvs/FileSystemPlugins/src/T_TestFSY.cpp Fri Jun 15 03:10:57 2012 +0200
1.3 @@ -0,0 +1,91 @@
1.4 +/*
1.5 +* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
1.6 +* All rights reserved.
1.7 +* This component and the accompanying materials are made available
1.8 +* under the terms of "Eclipse Public License v1.0"
1.9 +* which accompanies this distribution, and is available
1.10 +* at the URL "http://www.eclipse.org/legal/epl-v10.html".
1.11 +*
1.12 +* Initial Contributors:
1.13 +* Nokia Corporation - initial contribution.
1.14 +*
1.15 +* Contributors:
1.16 +*
1.17 +* Description:
1.18 +*
1.19 +*/
1.20 +
1.21 +
1.22 +#include "T_TestFSY.h"
1.23 +
1.24 +/*@{*/
1.25 +_LIT(KDefaultPath, "C:\\");
1.26 +/*@}*/
1.27 +
1.28 +CTestFileSystem::CTestFileSystem()
1.29 +//
1.30 +// Constructor
1.31 +//
1.32 + {
1.33 + }
1.34 +
1.35 +CMountCB* CTestFileSystem::NewMountL() const
1.36 +//
1.37 +// Create a new mount control block
1.38 +//
1.39 + {
1.40 + return (new(ELeave) CTestMountCB);
1.41 + }
1.42 +
1.43 +CFileCB* CTestFileSystem::NewFileL() const
1.44 +//
1.45 +// Create a new file
1.46 +//
1.47 + {
1.48 + return (new(ELeave) CTestFileCB);
1.49 + }
1.50 +
1.51 +CDirCB* CTestFileSystem::NewDirL() const
1.52 +//
1.53 +// create a new directory lister
1.54 +//
1.55 + {
1.56 + return (new(ELeave) CTestDirCB);
1.57 + }
1.58 +
1.59 +CFormatCB* CTestFileSystem::NewFormatL() const
1.60 +//
1.61 +// Create a new media formatter
1.62 +//
1.63 + {
1.64 + return (new(ELeave) CTestFormatCB);
1.65 + }
1.66 +
1.67 +TInt CTestFileSystem::DefaultPath(TDes& aPath) const
1.68 +//
1.69 +// Return the intial default path
1.70 +//
1.71 + {
1.72 + aPath=KDefaultPath;
1.73 + return KErrNone;
1.74 + }
1.75 +
1.76 +void CTestFileSystem::DriveInfo(TDriveInfo& anInfo,TInt aDriveNumber) const
1.77 +//
1.78 +// Return drive info - iDriveAtt and iBatteryState are already set
1.79 +//
1.80 + {
1.81 + TLocalDriveCapsV2Buf localDriveCaps;
1.82 + DriveNumberToLocalDrive(aDriveNumber).Caps(localDriveCaps);
1.83 + anInfo.iMediaAtt=localDriveCaps().iMediaAtt;
1.84 + anInfo.iType=localDriveCaps().iType;
1.85 + anInfo.iDriveAtt=localDriveCaps().iDriveAtt;
1.86 + }
1.87 +
1.88 +TBusLocalDrive& CTestFileSystem::DriveNumberToLocalDrive(TInt aDriveNumber) const
1.89 +//
1.90 +// Return the local drive associated with aDriveNumber
1.91 +//
1.92 + {
1.93 + return(GetLocalDrive(aDriveNumber));
1.94 + }