sl@0
|
1 |
/**
|
sl@0
|
2 |
* Copyright (c) 1996-2009 Nokia Corporation and/or its subsidiary(-ies).
|
sl@0
|
3 |
* All rights reserved.
|
sl@0
|
4 |
* This component and the accompanying materials are made available
|
sl@0
|
5 |
* under the terms of the License "Eclipse Public License v1.0"
|
sl@0
|
6 |
* which accompanies this distribution, and is available
|
sl@0
|
7 |
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
|
sl@0
|
8 |
*
|
sl@0
|
9 |
* Initial Contributors:
|
sl@0
|
10 |
* Nokia Corporation - initial contribution.
|
sl@0
|
11 |
*
|
sl@0
|
12 |
* Contributors:
|
sl@0
|
13 |
*
|
sl@0
|
14 |
* Description:
|
sl@0
|
15 |
* File Name: f32test/server/t_file64bit.h
|
sl@0
|
16 |
* Include file for t_file64bit.cpp (PREQ 1725).
|
sl@0
|
17 |
*
|
sl@0
|
18 |
*
|
sl@0
|
19 |
*/
|
sl@0
|
20 |
|
sl@0
|
21 |
|
sl@0
|
22 |
|
sl@0
|
23 |
|
sl@0
|
24 |
|
sl@0
|
25 |
#if !defined(__T_FILE64BIT_H__)
|
sl@0
|
26 |
#define __T_FILE64BIT_H__
|
sl@0
|
27 |
|
sl@0
|
28 |
const TInt64 KKB = 1 << 10;
|
sl@0
|
29 |
const TInt64 K2KB = 2 * KKB;
|
sl@0
|
30 |
const TInt64 K4KB = 4 * KKB;
|
sl@0
|
31 |
const TInt64 K32KB = 8 * K4KB;
|
sl@0
|
32 |
const TInt64 KGB = 1 << 30;
|
sl@0
|
33 |
const TInt64 K2GB = 2 * KGB;
|
sl@0
|
34 |
const TInt64 K3GB = 3 * KGB;
|
sl@0
|
35 |
const TInt64 K4GB = 4 * KGB;
|
sl@0
|
36 |
const TInt64 K9GB = 9 * KGB;
|
sl@0
|
37 |
const TInt64 K12GB = 12 * KGB;
|
sl@0
|
38 |
const TInt64 K1GBMinusOne = KGB - 1;
|
sl@0
|
39 |
const TInt64 KSize1GMinus4K = KGB - K4KB;
|
sl@0
|
40 |
const TInt64 K2GBMinusOne = K2GB - 1;
|
sl@0
|
41 |
const TInt64 K2GBMinusTen = K2GB - 10;
|
sl@0
|
42 |
const TInt64 K2GBMinus100 = K2GB - 100;
|
sl@0
|
43 |
const TInt64 KSize2GMinus4K = K2GB - K4KB;
|
sl@0
|
44 |
const TInt64 K2GBPlusTen = K2GB + 10;
|
sl@0
|
45 |
const TInt64 K2GBPlus16 = K2GB + 16;
|
sl@0
|
46 |
const TInt64 K2GBPlus80 = K2GB + 80;
|
sl@0
|
47 |
const TInt64 K2GBPlus98 = K2GB + 98;
|
sl@0
|
48 |
const TInt64 K2GBPlus100 = K2GB + 100;
|
sl@0
|
49 |
const TInt64 K2GBPlus200 = K2GB + 100;
|
sl@0
|
50 |
const TInt64 K2GBPlus600 = K2GB + 600;
|
sl@0
|
51 |
const TInt64 K2GBPlus300 = K2GB + 300;
|
sl@0
|
52 |
const TInt64 K2GBPlus500 = K2GB + 500;
|
sl@0
|
53 |
const TInt64 K3GBMinusOne = K3GB - 1;
|
sl@0
|
54 |
const TInt64 KSize3GMinus4K = K3GB - K4KB;
|
sl@0
|
55 |
const TInt64 K4GBMinusOne = K4GB - 1;
|
sl@0
|
56 |
const TInt64 K4GBMinusTwo = K4GB - 2;
|
sl@0
|
57 |
const TInt64 K4GBMinusTen = K4GB - 10;
|
sl@0
|
58 |
const TInt64 K4GBMinus100 = K4GB - 100;
|
sl@0
|
59 |
const TInt64 KSize3GMinus1Minus4K = K3GB -1 - K4KB;
|
sl@0
|
60 |
const TInt64 KSize4GMinus1Minus4K = K4GB - 1 - K4KB;
|
sl@0
|
61 |
const TInt64 KSize2GMinus1Minus4K = K2GB - 2 - K4KB;
|
sl@0
|
62 |
const TInt64 K4GBPlusOne = K4GB + 1;
|
sl@0
|
63 |
const TInt64 K4GBPlusTen = K4GB + 10;
|
sl@0
|
64 |
|
sl@0
|
65 |
|
sl@0
|
66 |
const TInt KBUFSIZE = 10;
|
sl@0
|
67 |
const TInt KMAXBUFSIZE = 2*KKB;
|
sl@0
|
68 |
const TInt KWRITEBUFSIZE = KKB;
|
sl@0
|
69 |
LOCAL_D TBuf8<0x63> pattern;
|
sl@0
|
70 |
|
sl@0
|
71 |
// Maximum bytes per cluster recommended in FAT32
|
sl@0
|
72 |
const TInt KMaxClusterSize = K32KB;
|
sl@0
|
73 |
|
sl@0
|
74 |
//-------------------------------------------------------------------------------------------------------------------
|
sl@0
|
75 |
|
sl@0
|
76 |
_LIT(KFsName_FAT32, "Fat32");
|
sl@0
|
77 |
_LIT(KFsName_NGFS, "NGFS");
|
sl@0
|
78 |
_LIT(KFile2GBMinusOne, "File2GBMinusOne.txt");
|
sl@0
|
79 |
_LIT(KFile2GB, "File2GB.txt");
|
sl@0
|
80 |
_LIT(KFile3GB, "File3GB.txt");
|
sl@0
|
81 |
_LIT(KFile4GBMinusOne, "File4GBMinusOne.txt");
|
sl@0
|
82 |
_LIT( KClientFileName, "File4GBMinusOne.txt");
|
sl@0
|
83 |
_LIT(KServerName, "FHServer64bit");
|
sl@0
|
84 |
TInt gFilesInDirectory = 4;
|
sl@0
|
85 |
|
sl@0
|
86 |
TVolumeInfo gDriveVolumeInfo;
|
sl@0
|
87 |
TInt gDrive;
|
sl@0
|
88 |
// Static function prototypes.
|
sl@0
|
89 |
LOCAL_C void TestOpenFiles();
|
sl@0
|
90 |
LOCAL_C void TestAdoptFiles();
|
sl@0
|
91 |
|
sl@0
|
92 |
LOCAL_C void TestReadFile();
|
sl@0
|
93 |
LOCAL_C void TestWriteFile();
|
sl@0
|
94 |
LOCAL_C void TestFileAccess();
|
sl@0
|
95 |
LOCAL_C void TestLockUnLock();
|
sl@0
|
96 |
LOCAL_C void TestCopyMoveDirectory();
|
sl@0
|
97 |
|
sl@0
|
98 |
|
sl@0
|
99 |
class CFileManObserver : public CBase, public MFileManObserver
|
sl@0
|
100 |
{
|
sl@0
|
101 |
public:
|
sl@0
|
102 |
CFileManObserver(CFileMan* aFileMan);
|
sl@0
|
103 |
|
sl@0
|
104 |
TControl NotifyFileManStarted();
|
sl@0
|
105 |
TControl NotifyFileManOperation();
|
sl@0
|
106 |
TControl NotifyFileManEnded();
|
sl@0
|
107 |
private:
|
sl@0
|
108 |
CFileMan* iFileMan;
|
sl@0
|
109 |
public:
|
sl@0
|
110 |
TInt iNotifyEndedSuccesses;
|
sl@0
|
111 |
TInt iNotifyEndedFailures;
|
sl@0
|
112 |
};
|
sl@0
|
113 |
|
sl@0
|
114 |
|
sl@0
|
115 |
class RFsTest : public RFs
|
sl@0
|
116 |
{
|
sl@0
|
117 |
public:
|
sl@0
|
118 |
RFsTest& Replace(const TDesC &anOldName, const TDesC &aNewName);
|
sl@0
|
119 |
RFsTest& ReadFileSection(const TDesC& aName, TInt64 aPos, TDes8& aBuffer, TInt aLen);
|
sl@0
|
120 |
RFsTest& GetDir(const TDesC &aName, TUint anEntryAttMask, TUint anEntrySortKey, CDir *&anEntryList);
|
sl@0
|
121 |
RFsTest& GetDir(const TDesC& aName,TUint anEntryAttMask,TUint anEntrySortKey,CDir*& anEntryList,CDir*& aDirList);
|
sl@0
|
122 |
RFsTest& GetDir(const TDesC& aName,const TUidType& anEntryUid,TUint anEntrySortKey,CDir*& aFileList);
|
sl@0
|
123 |
};
|
sl@0
|
124 |
LOCAL_D RFsTest TestRFs;
|
sl@0
|
125 |
|
sl@0
|
126 |
class RFileTest : public RFile64
|
sl@0
|
127 |
{
|
sl@0
|
128 |
public:
|
sl@0
|
129 |
RFileTest(const TDesC& aName);
|
sl@0
|
130 |
RFileTest& Create(const TDesC& aName,TUint aFileMode);
|
sl@0
|
131 |
RFileTest& Replace(const TDesC& aName);
|
sl@0
|
132 |
RFileTest& Replace(const TDesC& aName, TUint aFileMode);
|
sl@0
|
133 |
RFileTest& Open(const TDesC& aName);
|
sl@0
|
134 |
RFileTest& Open(const TDesC& aName, TUint aFileMode);
|
sl@0
|
135 |
RFileTest& Temp(const TDesC& aPath,TFileName& aName,TUint aFileMode);
|
sl@0
|
136 |
void Close();
|
sl@0
|
137 |
RFileTest& Lock(TInt64 aPos,TInt64 aLen=1);
|
sl@0
|
138 |
RFileTest& LockE(TInt64 aPos,TInt64 aLen=1);
|
sl@0
|
139 |
RFileTest& UnLock(TInt64 aPos,TInt64 aLen=1);
|
sl@0
|
140 |
RFileTest& UnLockE(TInt64 aPos,TInt64 aLen=1);
|
sl@0
|
141 |
|
sl@0
|
142 |
RFileTest& Write(const TDesC8& aDes);
|
sl@0
|
143 |
RFileTest& Write(const TDesC8& aDes, TRequestStatus& aStatus);
|
sl@0
|
144 |
RFileTest& Write(const TDesC8& aDes, TInt aLength);
|
sl@0
|
145 |
RFileTest& Write(const TDesC8& aDes, TInt aLength, TRequestStatus &aStatus);
|
sl@0
|
146 |
RFileTest& Write(TInt64 aPos,const TDesC8& aDes,TInt aLen=1);
|
sl@0
|
147 |
RFileTest& WriteE(TInt64 aPos,const TDesC8& aDes,TInt aLen=1);
|
sl@0
|
148 |
RFileTest& Write(TInt64 aPos,const TDesC8& aDes,TInt aLen,TRequestStatus &aStatus);
|
sl@0
|
149 |
RFileTest& WriteP(TInt64 aPos,const TDesC8& aDes);
|
sl@0
|
150 |
RFileTest& Write(TInt64 aPos,const TDesC8& aDes,TRequestStatus& aStatus);
|
sl@0
|
151 |
RFileTest& WriteU(TUint aPos,const TDesC8& aDes);
|
sl@0
|
152 |
RFileTest& WriteU(TUint aPos,const TDesC8& aDes,TRequestStatus& aStatus);
|
sl@0
|
153 |
RFileTest& WriteU(TUint aPos,const TDesC8& aDes, TInt aLength);
|
sl@0
|
154 |
RFileTest& WriteU(TUint aPos,const TDesC8& aDes, TInt aLength,TRequestStatus& aStatus);
|
sl@0
|
155 |
|
sl@0
|
156 |
|
sl@0
|
157 |
RFileTest& Read(TDes8& aDes);
|
sl@0
|
158 |
RFileTest& Read(TDes8& aDes, TRequestStatus& aStatus);
|
sl@0
|
159 |
RFileTest& Read(TDes8 &aDes, TInt aLen);
|
sl@0
|
160 |
RFileTest& Read(TDes8 &aDes, TInt aLength, TRequestStatus &aStatus);
|
sl@0
|
161 |
RFileTest& Read(TInt64 aPos,TDes8& aDes,TInt aLen=1);
|
sl@0
|
162 |
RFileTest& ReadE(TInt64 aPos,TDes8& aDes,TInt aLen=1);
|
sl@0
|
163 |
RFileTest& Read(TInt64 aPos,TDes8& aDes);
|
sl@0
|
164 |
RFileTest& Read(TInt64 aPos,TDes8& aDes,TInt aLen, TRequestStatus& aStatus);
|
sl@0
|
165 |
RFileTest& ReadP(TInt64 aPos,TDes8& aDes);
|
sl@0
|
166 |
RFileTest& Read(TInt64 aPos,TDes8& aDes,TRequestStatus& aStatus);
|
sl@0
|
167 |
RFileTest& ReadU(TUint aPos,TDes8& aDes,TRequestStatus& aStatus);
|
sl@0
|
168 |
RFileTest& ReadU(TUint aPos,TDes8& aDes);
|
sl@0
|
169 |
RFileTest& ReadU(TUint aPos,TDes8& aDes, TInt aLength);
|
sl@0
|
170 |
RFileTest& ReadU(TUint aPos,TDes8& aDes, TInt aLength,TRequestStatus& aStatus);
|
sl@0
|
171 |
|
sl@0
|
172 |
RFileTest& SetSize(TInt64 aSize);
|
sl@0
|
173 |
RFileTest& SetSizeE(TInt64 aSize);
|
sl@0
|
174 |
RFileTest& Size(TInt64& aSize);
|
sl@0
|
175 |
RFileTest& Seek(TSeek aMode,TInt64& aPos);
|
sl@0
|
176 |
private:
|
sl@0
|
177 |
TName iName;
|
sl@0
|
178 |
};
|
sl@0
|
179 |
LOCAL_D RFileTest TestRFile1(_L("File 1"));
|
sl@0
|
180 |
LOCAL_D RFileTest TestRFile2(_L("File 2"));
|
sl@0
|
181 |
#endif
|