sl@0: /** sl@0: * Copyright (c) 1996-2009 Nokia Corporation and/or its subsidiary(-ies). sl@0: * All rights reserved. sl@0: * This component and the accompanying materials are made available sl@0: * under the terms of the License "Eclipse Public License v1.0" sl@0: * which accompanies this distribution, and is available sl@0: * at the URL "http://www.eclipse.org/legal/epl-v10.html". sl@0: * sl@0: * Initial Contributors: sl@0: * Nokia Corporation - initial contribution. sl@0: * sl@0: * Contributors: sl@0: * sl@0: * Description: sl@0: * File Name: f32test/server/t_file64bit.h sl@0: * Include file for t_file64bit.cpp (PREQ 1725). sl@0: * sl@0: * sl@0: */ sl@0: sl@0: sl@0: sl@0: sl@0: sl@0: #if !defined(__T_FILE64BIT_H__) sl@0: #define __T_FILE64BIT_H__ sl@0: sl@0: const TInt64 KKB = 1 << 10; sl@0: const TInt64 K2KB = 2 * KKB; sl@0: const TInt64 K4KB = 4 * KKB; sl@0: const TInt64 K32KB = 8 * K4KB; sl@0: const TInt64 KGB = 1 << 30; sl@0: const TInt64 K2GB = 2 * KGB; sl@0: const TInt64 K3GB = 3 * KGB; sl@0: const TInt64 K4GB = 4 * KGB; sl@0: const TInt64 K9GB = 9 * KGB; sl@0: const TInt64 K12GB = 12 * KGB; sl@0: const TInt64 K1GBMinusOne = KGB - 1; sl@0: const TInt64 KSize1GMinus4K = KGB - K4KB; sl@0: const TInt64 K2GBMinusOne = K2GB - 1; sl@0: const TInt64 K2GBMinusTen = K2GB - 10; sl@0: const TInt64 K2GBMinus100 = K2GB - 100; sl@0: const TInt64 KSize2GMinus4K = K2GB - K4KB; sl@0: const TInt64 K2GBPlusTen = K2GB + 10; sl@0: const TInt64 K2GBPlus16 = K2GB + 16; sl@0: const TInt64 K2GBPlus80 = K2GB + 80; sl@0: const TInt64 K2GBPlus98 = K2GB + 98; sl@0: const TInt64 K2GBPlus100 = K2GB + 100; sl@0: const TInt64 K2GBPlus200 = K2GB + 100; sl@0: const TInt64 K2GBPlus600 = K2GB + 600; sl@0: const TInt64 K2GBPlus300 = K2GB + 300; sl@0: const TInt64 K2GBPlus500 = K2GB + 500; sl@0: const TInt64 K3GBMinusOne = K3GB - 1; sl@0: const TInt64 KSize3GMinus4K = K3GB - K4KB; sl@0: const TInt64 K4GBMinusOne = K4GB - 1; sl@0: const TInt64 K4GBMinusTwo = K4GB - 2; sl@0: const TInt64 K4GBMinusTen = K4GB - 10; sl@0: const TInt64 K4GBMinus100 = K4GB - 100; sl@0: const TInt64 KSize3GMinus1Minus4K = K3GB -1 - K4KB; sl@0: const TInt64 KSize4GMinus1Minus4K = K4GB - 1 - K4KB; sl@0: const TInt64 KSize2GMinus1Minus4K = K2GB - 2 - K4KB; sl@0: const TInt64 K4GBPlusOne = K4GB + 1; sl@0: const TInt64 K4GBPlusTen = K4GB + 10; sl@0: sl@0: sl@0: const TInt KBUFSIZE = 10; sl@0: const TInt KMAXBUFSIZE = 2*KKB; sl@0: const TInt KWRITEBUFSIZE = KKB; sl@0: LOCAL_D TBuf8<0x63> pattern; sl@0: sl@0: // Maximum bytes per cluster recommended in FAT32 sl@0: const TInt KMaxClusterSize = K32KB; sl@0: sl@0: //------------------------------------------------------------------------------------------------------------------- sl@0: sl@0: _LIT(KFsName_FAT32, "Fat32"); sl@0: _LIT(KFsName_NGFS, "NGFS"); sl@0: _LIT(KFile2GBMinusOne, "File2GBMinusOne.txt"); sl@0: _LIT(KFile2GB, "File2GB.txt"); sl@0: _LIT(KFile3GB, "File3GB.txt"); sl@0: _LIT(KFile4GBMinusOne, "File4GBMinusOne.txt"); sl@0: _LIT( KClientFileName, "File4GBMinusOne.txt"); sl@0: _LIT(KServerName, "FHServer64bit"); sl@0: TInt gFilesInDirectory = 4; sl@0: sl@0: TVolumeInfo gDriveVolumeInfo; sl@0: TInt gDrive; sl@0: // Static function prototypes. sl@0: LOCAL_C void TestOpenFiles(); sl@0: LOCAL_C void TestAdoptFiles(); sl@0: sl@0: LOCAL_C void TestReadFile(); sl@0: LOCAL_C void TestWriteFile(); sl@0: LOCAL_C void TestFileAccess(); sl@0: LOCAL_C void TestLockUnLock(); sl@0: LOCAL_C void TestCopyMoveDirectory(); sl@0: sl@0: sl@0: class CFileManObserver : public CBase, public MFileManObserver sl@0: { sl@0: public: sl@0: CFileManObserver(CFileMan* aFileMan); sl@0: sl@0: TControl NotifyFileManStarted(); sl@0: TControl NotifyFileManOperation(); sl@0: TControl NotifyFileManEnded(); sl@0: private: sl@0: CFileMan* iFileMan; sl@0: public: sl@0: TInt iNotifyEndedSuccesses; sl@0: TInt iNotifyEndedFailures; sl@0: }; sl@0: sl@0: sl@0: class RFsTest : public RFs sl@0: { sl@0: public: sl@0: RFsTest& Replace(const TDesC &anOldName, const TDesC &aNewName); sl@0: RFsTest& ReadFileSection(const TDesC& aName, TInt64 aPos, TDes8& aBuffer, TInt aLen); sl@0: RFsTest& GetDir(const TDesC &aName, TUint anEntryAttMask, TUint anEntrySortKey, CDir *&anEntryList); sl@0: RFsTest& GetDir(const TDesC& aName,TUint anEntryAttMask,TUint anEntrySortKey,CDir*& anEntryList,CDir*& aDirList); sl@0: RFsTest& GetDir(const TDesC& aName,const TUidType& anEntryUid,TUint anEntrySortKey,CDir*& aFileList); sl@0: }; sl@0: LOCAL_D RFsTest TestRFs; sl@0: sl@0: class RFileTest : public RFile64 sl@0: { sl@0: public: sl@0: RFileTest(const TDesC& aName); sl@0: RFileTest& Create(const TDesC& aName,TUint aFileMode); sl@0: RFileTest& Replace(const TDesC& aName); sl@0: RFileTest& Replace(const TDesC& aName, TUint aFileMode); sl@0: RFileTest& Open(const TDesC& aName); sl@0: RFileTest& Open(const TDesC& aName, TUint aFileMode); sl@0: RFileTest& Temp(const TDesC& aPath,TFileName& aName,TUint aFileMode); sl@0: void Close(); sl@0: RFileTest& Lock(TInt64 aPos,TInt64 aLen=1); sl@0: RFileTest& LockE(TInt64 aPos,TInt64 aLen=1); sl@0: RFileTest& UnLock(TInt64 aPos,TInt64 aLen=1); sl@0: RFileTest& UnLockE(TInt64 aPos,TInt64 aLen=1); sl@0: sl@0: RFileTest& Write(const TDesC8& aDes); sl@0: RFileTest& Write(const TDesC8& aDes, TRequestStatus& aStatus); sl@0: RFileTest& Write(const TDesC8& aDes, TInt aLength); sl@0: RFileTest& Write(const TDesC8& aDes, TInt aLength, TRequestStatus &aStatus); sl@0: RFileTest& Write(TInt64 aPos,const TDesC8& aDes,TInt aLen=1); sl@0: RFileTest& WriteE(TInt64 aPos,const TDesC8& aDes,TInt aLen=1); sl@0: RFileTest& Write(TInt64 aPos,const TDesC8& aDes,TInt aLen,TRequestStatus &aStatus); sl@0: RFileTest& WriteP(TInt64 aPos,const TDesC8& aDes); sl@0: RFileTest& Write(TInt64 aPos,const TDesC8& aDes,TRequestStatus& aStatus); sl@0: RFileTest& WriteU(TUint aPos,const TDesC8& aDes); sl@0: RFileTest& WriteU(TUint aPos,const TDesC8& aDes,TRequestStatus& aStatus); sl@0: RFileTest& WriteU(TUint aPos,const TDesC8& aDes, TInt aLength); sl@0: RFileTest& WriteU(TUint aPos,const TDesC8& aDes, TInt aLength,TRequestStatus& aStatus); sl@0: sl@0: sl@0: RFileTest& Read(TDes8& aDes); sl@0: RFileTest& Read(TDes8& aDes, TRequestStatus& aStatus); sl@0: RFileTest& Read(TDes8 &aDes, TInt aLen); sl@0: RFileTest& Read(TDes8 &aDes, TInt aLength, TRequestStatus &aStatus); sl@0: RFileTest& Read(TInt64 aPos,TDes8& aDes,TInt aLen=1); sl@0: RFileTest& ReadE(TInt64 aPos,TDes8& aDes,TInt aLen=1); sl@0: RFileTest& Read(TInt64 aPos,TDes8& aDes); sl@0: RFileTest& Read(TInt64 aPos,TDes8& aDes,TInt aLen, TRequestStatus& aStatus); sl@0: RFileTest& ReadP(TInt64 aPos,TDes8& aDes); sl@0: RFileTest& Read(TInt64 aPos,TDes8& aDes,TRequestStatus& aStatus); sl@0: RFileTest& ReadU(TUint aPos,TDes8& aDes,TRequestStatus& aStatus); sl@0: RFileTest& ReadU(TUint aPos,TDes8& aDes); sl@0: RFileTest& ReadU(TUint aPos,TDes8& aDes, TInt aLength); sl@0: RFileTest& ReadU(TUint aPos,TDes8& aDes, TInt aLength,TRequestStatus& aStatus); sl@0: sl@0: RFileTest& SetSize(TInt64 aSize); sl@0: RFileTest& SetSizeE(TInt64 aSize); sl@0: RFileTest& Size(TInt64& aSize); sl@0: RFileTest& Seek(TSeek aMode,TInt64& aPos); sl@0: private: sl@0: TName iName; sl@0: }; sl@0: LOCAL_D RFileTest TestRFile1(_L("File 1")); sl@0: LOCAL_D RFileTest TestRFile2(_L("File 2")); sl@0: #endif