|
1 // Copyright (c) 1998-2009 Nokia Corporation and/or its subsidiary(-ies). |
|
2 // All rights reserved. |
|
3 // This component and the accompanying materials are made available |
|
4 // under the terms of "Eclipse Public License v1.0" |
|
5 // which accompanies this distribution, and is available |
|
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
7 // |
|
8 // Initial Contributors: |
|
9 // Nokia Corporation - initial contribution. |
|
10 // |
|
11 // Contributors: |
|
12 // |
|
13 // Description: |
|
14 // |
|
15 |
|
16 // Class RFileBuf |
|
17 inline void RFileBuf::Reset(TInt aSize) |
|
18 /** Frees the intermediate buffer and changes the size of any future intermediate |
|
19 buffer to the specified value. |
|
20 |
|
21 The intermediate buffer must not contain any outstanding write data, otherwise |
|
22 the function raises a STORE-File 6 panic. |
|
23 |
|
24 @param aSize The size of any future intermediate buffer. */ |
|
25 {Reset();iSize=aSize;} |
|
26 inline void RFileBuf::Detach() |
|
27 /** Detaches the file from this stream buffer. |
|
28 |
|
29 The intermediate buffer's read and write marks are not changed, and the stream |
|
30 positions are not changed. This means that the contents of the file should |
|
31 not change while it is detached. |
|
32 |
|
33 @see Attach() |
|
34 @see Reattach() */ |
|
35 {iFile=RFile();} |
|
36 inline void RFileBuf::Reattach(RFile& aFile) |
|
37 /** Re-attaches the specified file to this stream buffer. |
|
38 |
|
39 The intermediate buffer's read and write marks are not changed, and the stream |
|
40 positions are not changed. |
|
41 |
|
42 The file should be the one that was detached using the Detach() function. |
|
43 |
|
44 @param aFile The file to be re-attached. |
|
45 @see Attach() |
|
46 @see Detach() */ |
|
47 {iFile=aFile;} |
|
48 inline RFile& RFileBuf::File() const |
|
49 /** Gets a reference to the file attached to this stream buffer. |
|
50 |
|
51 @return The file attached to this stream buffer. */ |
|
52 {return MUTABLE_CAST(RFile&,iFile);} |
|
53 |
|
54 // Class RFileWriteStream |
|
55 inline RFileWriteStream::RFileWriteStream(const MExternalizer<TStreamRef>& anExter) |
|
56 : RWriteStream(anExter) |
|
57 {} |
|
58 |
|
59 // Class CFileStore |
|
60 inline const TUidType& CFileStore::Type() const |
|
61 /** Gets the UID type of the file store. |
|
62 |
|
63 @return The UID type object containing the file store type. |
|
64 @see TUid */ |
|
65 {return iType;} |
|
66 inline void CFileStore::Reset() |
|
67 /** Frees the file store’s buffer space. |
|
68 |
|
69 The buffer space is automatically re-allocated when needed. |
|
70 |
|
71 This function should only be used immediately after a successful call to CommitL() |
|
72 or RevertL(). |
|
73 |
|
74 @see CStreamStore::CommitL() |
|
75 @see CStreamStore::RevertL() */ |
|
76 {iBuf.Reset();} |
|
77 inline void CFileStore::Reset(TInt aSize) |
|
78 /** Frees the file store’s buffer space and changes the size of future buffer |
|
79 space allocations. |
|
80 |
|
81 The buffer space is automatically re-allocated when needed, using the new |
|
82 size value. |
|
83 |
|
84 This function should only be used immediately after a successful call to CommitL() |
|
85 or RevertL(). |
|
86 |
|
87 @param aSize The size of future buffer space allocations. |
|
88 @see CStreamStore::CommitL() |
|
89 @see CStreamStore::RevertL() */ |
|
90 {iBuf.Reset(aSize);} |
|
91 inline void CFileStore::Detach() |
|
92 /** Detaches the file store from its associated file. |
|
93 |
|
94 In effect, the file store gives up ownership of the file. |
|
95 |
|
96 Detaching is useful in cases where a file needs to be closed and later re-opened; |
|
97 for example, to give up a write lock for backup purposes. |
|
98 |
|
99 It is very important that the contents of the file should not change while |
|
100 it is detached. |
|
101 |
|
102 @see File() |
|
103 @see Reattach() */ |
|
104 {iBuf.Detach();} |
|
105 inline void CFileStore::Reattach(RFile& aFile) |
|
106 /** Reattaches a file to the file store. The file should be the one that was detached |
|
107 using the Detach() function. |
|
108 |
|
109 @param aFile The file to be associated with this file store. |
|
110 @see File() */ |
|
111 {iBuf.Reattach(aFile);} |
|
112 inline RFile& CFileStore::File() const |
|
113 /** Gets a reference to the file associated with this file store. |
|
114 |
|
115 This function is called prior to detaching the file store. |
|
116 |
|
117 @return A reference to the associated file. |
|
118 @see Detach() */ |
|
119 {return iBuf.File();} |
|
120 inline TStreamExchange& CFileStore::Host() const |
|
121 {return MUTABLE_CAST(TStreamExchange&,iHost);} |
|
122 inline TBool CFileStore::IsHost(const MStreamBuf* aBuf) const |
|
123 {return aBuf==&iBuf;} |
|
124 inline void CFileStore::SetSizeL(TInt aSize) |
|
125 {iBuf.SetSizeL(aSize);} |
|
126 |
|
127 // Class CDirectFileStore |
|
128 inline CDirectFileStore* CDirectFileStore::OpenL(RFs& aFs,const TDesC& aName,TUint aFileMode) |
|
129 /** Opens a file containing a direct file store, and constructs a direct file store |
|
130 object. |
|
131 |
|
132 @param aFs Handle to a file server session. |
|
133 @param aName The full path name of the file containing the store. |
|
134 @param aFileMode The mode in which the file is to be accessed. The mode is |
|
135 defined by the TFileMode type. |
|
136 @return A pointer to the new direct file store object. |
|
137 @see TFileMode */ |
|
138 {return STATIC_CAST(CDirectFileStore*,CFileStore::OpenL(aFs,aName,aFileMode,KDirectFileStoreFactoryFunction));} |
|
139 inline CDirectFileStore* CDirectFileStore::OpenLC(RFs& aFs,const TDesC& aName,TUint aFileMode) |
|
140 /** Opens a file containing a direct file store, constructs a direct file store |
|
141 object, and places the pointer onto the cleanup stack. |
|
142 |
|
143 @param aFs Handle to a file server session. |
|
144 @param aName The full path name of the file containing the store. |
|
145 @param aFileMode The mode in which the file is to be accessed. The mode is |
|
146 defined by the TFileMode type. |
|
147 @return A pointer to the new direct file store object. |
|
148 @see TFileMode */ |
|
149 {return STATIC_CAST(CDirectFileStore*,CFileStore::OpenLC(aFs,aName,aFileMode,KDirectFileStoreFactoryFunction));} |
|
150 inline CDirectFileStore* CDirectFileStore::CreateL(RFs& aFs,const TDesC& aName,TUint aFileMode) |
|
151 /** Creates a new file and constructs a new direct file store object to be associated |
|
152 with this file. |
|
153 |
|
154 @param aFs Handle to a file server session. |
|
155 @param aName The full path name of the new file. A file with this name must |
|
156 not already exist, otherwise the function leaves. |
|
157 @param aFileMode The mode in which the file is to be accessed. The mode is |
|
158 defined by the TFileMode type. |
|
159 @return A pointer to the new direct file store object |
|
160 @see TFileMode */ |
|
161 {return STATIC_CAST(CDirectFileStore*,CFileStore::CreateL(aFs,aName,aFileMode,&DoNewL));} |
|
162 inline CDirectFileStore* CDirectFileStore::CreateLC(RFs& aFs,const TDesC& aName,TUint aFileMode) |
|
163 /** Creates a new file and constructs a new direct file store object to be associated |
|
164 with this file, and places the pointer onto the cleanup stack. |
|
165 |
|
166 @param aFs Handle to a file server session. |
|
167 @param aName The full path name of the new file. A file with this name must |
|
168 not already exist, otherwise the function leaves. |
|
169 @param aFileMode The mode in which the file is to be accessed. The mode is |
|
170 defined by the TFileMode type. |
|
171 @return A pointer to the new direct file store object |
|
172 @see TFileMode */ |
|
173 {return STATIC_CAST(CDirectFileStore*,CFileStore::CreateLC(aFs,aName,aFileMode,&DoNewL));} |
|
174 inline CDirectFileStore* CDirectFileStore::ReplaceL(RFs& aFs,const TDesC& aName,TUint aFileMode) |
|
175 /** Creates a file and constructs a direct file store object to be associated with |
|
176 it. |
|
177 |
|
178 The file replaces any existing file of the same name. |
|
179 |
|
180 @param aFs Handle to a file server session. |
|
181 @param aName The full path name of the file to be replaced. |
|
182 @param aFileMode The mode in which the file is to be accessed. The mode is |
|
183 defined by the TFileMode type. |
|
184 @return A pointer to the new direct file store object. |
|
185 @see TFileMode */ |
|
186 {return STATIC_CAST(CDirectFileStore*,CFileStore::ReplaceL(aFs,aName,aFileMode,&DoNewL));} |
|
187 inline CDirectFileStore* CDirectFileStore::ReplaceLC(RFs& aFs,const TDesC& aName,TUint aFileMode) |
|
188 /** Creates a file, constructs a direct file store object to be associated with |
|
189 it, and places the pointer onto the cleanup stack. |
|
190 |
|
191 The file replaces any existing file of the same name. |
|
192 |
|
193 @param aFs Handle to a file server session. |
|
194 @param aName The full path name of the file to be replaced. |
|
195 @param aFileMode The mode in which the file is to be accessed. The mode is |
|
196 defined by the TFileMode type. |
|
197 @return A pointer to the new direct file store object. |
|
198 @see TFileMode */ |
|
199 {return STATIC_CAST(CDirectFileStore*,CFileStore::ReplaceLC(aFs,aName,aFileMode,&DoNewL));} |
|
200 inline CDirectFileStore* CDirectFileStore::TempL(RFs& aFs,const TDesC& aPath,TFileName& aName,TUint aFileMode) |
|
201 /** Creates a temporary file and constructs a direct file store object to be associated |
|
202 with it. |
|
203 |
|
204 The new file is created in the specified path and a unique file name is generated |
|
205 by the file server. |
|
206 |
|
207 Note that the store framework does not delete a temporary file after it is |
|
208 closed. |
|
209 |
|
210 @param aFs Handle to a file server session. |
|
211 @param aPath The path where the new file is to be created. |
|
212 @param aName On return, contains the full path name of the new file. |
|
213 @param aFileMode The mode in which the new file is to be accessed. The mode |
|
214 is defined by the TFileMode type. |
|
215 @return A pointer to the new direct file store object. |
|
216 @see TFileMode */ |
|
217 {return STATIC_CAST(CDirectFileStore*,CFileStore::TempL(aFs,aPath,aName,aFileMode,&DoNewL));} |
|
218 inline CDirectFileStore* CDirectFileStore::TempLC(RFs& aFs,const TDesC& aPath,TFileName& aName,TUint aFileMode) |
|
219 /** Creates a temporary file, constructs a direct file store object to be associated |
|
220 with it, and places the pointer onto the cleanup stack. |
|
221 |
|
222 The new file is created in the specified path and a unique file name is generated |
|
223 by the file server. |
|
224 |
|
225 Note that the store framework does not delete a temporary file after it is |
|
226 closed. |
|
227 |
|
228 @param aFs Handle to a file server session. |
|
229 @param aPath The path where the new file is to be created. |
|
230 @param aName On return, contains the full path name of the new file. |
|
231 @param aFileMode The mode in which the new file is to be accessed. The mode |
|
232 is defined by the TFileMode type. |
|
233 @return A pointer to the new direct file store object. |
|
234 @see TFileMode */ |
|
235 {return STATIC_CAST(CDirectFileStore*,CFileStore::TempLC(aFs,aPath,aName,aFileMode,&DoNewL));} |
|
236 inline CDirectFileStore* CDirectFileStore::FromL(RFile& aFile) |
|
237 /** Constructs a direct file store object from an already opened file. |
|
238 |
|
239 The file must already be open before calling this function. |
|
240 |
|
241 Note that ownership of the file passes to the store. The referenced RFile |
|
242 is cleared and is no longer valid. |
|
243 |
|
244 @param aFile A reference to the opened file. |
|
245 @return A pointer to the new direct file store object. */ |
|
246 {return STATIC_CAST(CDirectFileStore*,CFileStore::FromL(aFile,KDirectFileStoreFactoryFunction));} |
|
247 inline CDirectFileStore* CDirectFileStore::FromLC(RFile& aFile) |
|
248 /** Constructs a direct file store object from an already opened file, and places |
|
249 the pointer onto the cleanup stack. |
|
250 |
|
251 The file must already be open before calling this function. |
|
252 |
|
253 Note that ownership of the file passes to the store. The referenced RFile |
|
254 is cleared and is no longer valid. |
|
255 |
|
256 @param aFile A reference to the opened file. |
|
257 @return A pointer to the new direct file store object. */ |
|
258 {return STATIC_CAST(CDirectFileStore*,CFileStore::FromLC(aFile,KDirectFileStoreFactoryFunction));} |
|
259 inline CDirectFileStore* CDirectFileStore::NewL(RFile& aFile) |
|
260 /** Constructs a new direct file store object in an already opened file. |
|
261 |
|
262 The file must already be open before calling the function. The existing content |
|
263 of the file is discarded. |
|
264 |
|
265 Note that ownership of the file passes to the store. The referenced RFile |
|
266 is cleared and is no longer valid: |
|
267 |
|
268 @param aFile A reference to the opened file. |
|
269 @return A pointer to the new direct file store object. */ |
|
270 {return STATIC_CAST(CDirectFileStore*,CFileStore::NewL(aFile,&DoNewL));} |
|
271 inline CDirectFileStore* CDirectFileStore::NewLC(RFile& aFile) |
|
272 /** Constructs a new direct file store object in an already opened file and places |
|
273 the pointer onto the cleanup stack. |
|
274 |
|
275 The file must already be open before calling the function. The existing content |
|
276 of the file is discarded. |
|
277 |
|
278 Note that ownership of the file passes to the store. The referenced RFile |
|
279 is cleared and is no longer valid: |
|
280 |
|
281 @param aFile A reference to the opened file. |
|
282 @return A pointer to the new direct file store object. */ |
|
283 {return STATIC_CAST(CDirectFileStore*,CFileStore::NewLC(aFile,&DoNewL));} |
|
284 |
|
285 // Class CPermanentFileStore |
|
286 inline CPermanentFileStore* CPermanentFileStore::OpenL(RFs& aFs,const TDesC& aName,TUint aFileMode) |
|
287 /** Opens a file containing a permanent file store, and constructs a permanent |
|
288 file store object. |
|
289 |
|
290 @param aFs Handle to a file server session. |
|
291 @param aName The full path name of the file containing the store. |
|
292 @param aFileMode The mode in which the file is to be accessed. The mode is |
|
293 defined by the TFileMode type. |
|
294 @return A pointer to the new permanent file store object. |
|
295 @see TFileMode */ |
|
296 {return STATIC_CAST(CPermanentFileStore*,CFileStore::OpenL(aFs,aName,aFileMode,KPermanentFileStoreFactoryFunction));} |
|
297 inline CPermanentFileStore* CPermanentFileStore::OpenLC(RFs& aFs,const TDesC& aName,TUint aFileMode) |
|
298 /** Opens a file containing a permanent file store, constructs a permanent file |
|
299 store object, and places the pointer onto the cleanup stack. |
|
300 |
|
301 @param aFs Handle to a file server session. |
|
302 @param aName The full path name of the file containing the store. |
|
303 @param aFileMode The mode in which the file is to be accessed. The mode is |
|
304 defined by the TFileMode type. |
|
305 @return A pointer to the new permanent file store object. |
|
306 @see TFileMode */ |
|
307 {return STATIC_CAST(CPermanentFileStore*,CFileStore::OpenLC(aFs,aName,aFileMode,KPermanentFileStoreFactoryFunction));} |
|
308 inline CPermanentFileStore* CPermanentFileStore::CreateL(RFs& aFs,const TDesC& aName,TUint aFileMode) |
|
309 /** Creates a new file and constructs a new permanent file store object to be associated |
|
310 with this file. |
|
311 |
|
312 @param aFs Handle to a file server session. |
|
313 @param aName The full path name of the new file. A file with this name must |
|
314 not already exist, otherwise the function leaves. |
|
315 @param aFileMode The mode in which the new file is to be accessed. This mode |
|
316 is defined by the TFileMode type. |
|
317 @return A pointer to the new permanent file store object. |
|
318 @see TFileMode */ |
|
319 {return STATIC_CAST(CPermanentFileStore*,CFileStore::CreateL(aFs,aName,aFileMode,&DoNewL));} |
|
320 inline CPermanentFileStore* CPermanentFileStore::CreateLC(RFs& aFs,const TDesC& aName,TUint aFileMode) |
|
321 /** Creates a new file and constructs a new permanent file store object to be associated |
|
322 with this file, and places the pointer onto the cleanup stack. |
|
323 |
|
324 @param aFs Handle to a file server session. |
|
325 @param aName The full path name of the new file. A file with this name must |
|
326 not already exist, otherwise the function leaves. |
|
327 @param aFileMode The mode in which the new file is to be accessed. This mode |
|
328 is defined by the TFileMode type. |
|
329 @return A pointer to the new permanent file store object. |
|
330 @see TFileMode */ |
|
331 {return STATIC_CAST(CPermanentFileStore*,CFileStore::CreateLC(aFs,aName,aFileMode,&DoNewL));} |
|
332 inline CPermanentFileStore* CPermanentFileStore::ReplaceL(RFs& aFs,const TDesC& aName,TUint aFileMode) |
|
333 /** Creates a file, constructs a permanent file store object to be associated with |
|
334 it. |
|
335 |
|
336 This file replaces any existing file of the same name. |
|
337 |
|
338 @param aFs Handle to a file server session. |
|
339 @param aName The full path name of the file to be replaced. |
|
340 @param aFileMode The mode in which the file is to be accessed. The mode is |
|
341 defined by the TFileMode type. |
|
342 @return A pointer to the new permanent file store object. |
|
343 @see TFileMode */ |
|
344 {return STATIC_CAST(CPermanentFileStore*,CFileStore::ReplaceL(aFs,aName,aFileMode,&DoNewL));} |
|
345 inline CPermanentFileStore* CPermanentFileStore::ReplaceLC(RFs& aFs,const TDesC& aName,TUint aFileMode) |
|
346 /** Creates a file, constructs a permanent file store object to be associated with |
|
347 it, and places the pointer onto the cleanup stack. |
|
348 |
|
349 This file replaces any existing file of the same name. |
|
350 |
|
351 @param aFs Handle to a file server session. |
|
352 @param aName The full path name of the file to be replaced. |
|
353 @param aFileMode The mode in which the file is to be accessed. The mode is |
|
354 defined by the TFileMode type. |
|
355 @return A pointer to the new permanent file store object. |
|
356 @see TFileMode */ |
|
357 {return STATIC_CAST(CPermanentFileStore*,CFileStore::ReplaceLC(aFs,aName,aFileMode,&DoNewL));} |
|
358 inline CPermanentFileStore* CPermanentFileStore::TempL(RFs& aFs,const TDesC& aPath,TFileName& aName,TUint aFileMode) |
|
359 /** Creates a temporary file and constructs a permanent file store object to be |
|
360 associated with it. |
|
361 |
|
362 The new file is created in the specified path and a unique file name is generated |
|
363 by the file server. |
|
364 |
|
365 Note that the store framework does not delete a temporary file after it is |
|
366 closed. |
|
367 |
|
368 @param aFs Handle to a file server session. |
|
369 @param aPath The path where the new file is to be created. |
|
370 @param aName On return, contains the full path name of the new file. |
|
371 @param aFileMode The mode in which the file is to be accessed. The mode is |
|
372 defined by the TFileMode type. |
|
373 @return A pointer to the new permanent file store object. |
|
374 @see TFileMode */ |
|
375 {return STATIC_CAST(CPermanentFileStore*,CFileStore::TempL(aFs,aPath,aName,aFileMode,&DoNewL));} |
|
376 inline CPermanentFileStore* CPermanentFileStore::TempLC(RFs& aFs,const TDesC& aPath,TFileName& aName,TUint aFileMode) |
|
377 /** Creates a temporary file, constructs a permanent file store object to be associated |
|
378 with it, and places the pointer onto the cleanup stack. |
|
379 |
|
380 The new file is created in the specified path and a unique file name is generated |
|
381 by the file server. |
|
382 |
|
383 Note that the store framework does not delete a temporary file after it is |
|
384 closed. |
|
385 |
|
386 @param aFs Handle to a file server session. |
|
387 @param aPath The path where the new file is to be created. |
|
388 @param aName On return, contains the full path name of the new file. |
|
389 @param aFileMode The mode in which the file is to be accessed. The mode is |
|
390 defined by the TFileMode type. |
|
391 @return A pointer to the new permanent file store object. |
|
392 @see TFileMode */ |
|
393 {return STATIC_CAST(CPermanentFileStore*,CFileStore::TempLC(aFs,aPath,aName,aFileMode,&DoNewL));} |
|
394 inline CPermanentFileStore* CPermanentFileStore::FromL(RFile& aFile) |
|
395 /** Constructs a permanent file store object from an already opened file. |
|
396 |
|
397 The file must already be open before calling this function. |
|
398 |
|
399 Note that ownership of the file passes to the store. The referenced RFile |
|
400 is cleared and is no longer valid. |
|
401 |
|
402 @param aFile A reference to the opened file. |
|
403 @return A pointer to the new permanent file store object. */ |
|
404 {return STATIC_CAST(CPermanentFileStore*,CFileStore::FromL(aFile,KPermanentFileStoreFactoryFunction));} |
|
405 inline CPermanentFileStore* CPermanentFileStore::FromLC(RFile& aFile) |
|
406 /** Constructs a permanent file store object from an already opened file, and places |
|
407 the pointer onto the cleanup stack. |
|
408 |
|
409 The file must already be open before calling this function. |
|
410 |
|
411 Note that ownership of the file passes to the store. The referenced RFile |
|
412 is cleared and is no longer valid. |
|
413 |
|
414 @param aFile A reference to the opened file. |
|
415 @return A pointer to the new permanent file store object. */ |
|
416 {return STATIC_CAST(CPermanentFileStore*,CFileStore::FromLC(aFile,KPermanentFileStoreFactoryFunction));} |
|
417 inline CPermanentFileStore* CPermanentFileStore::NewL(RFile& aFile) |
|
418 /** Constructs a new permanent file store object in an already opened file. |
|
419 |
|
420 The file must already be open before calling this function. The existing content |
|
421 of the file is discarded. |
|
422 |
|
423 Note that ownership of the file passes to the store. The referenced RFile |
|
424 is cleared and is no longer valid. |
|
425 |
|
426 @param aFile A reference to the opened file. |
|
427 @return A pointer to the new permanent file store object. */ |
|
428 {return STATIC_CAST(CPermanentFileStore*,CFileStore::NewL(aFile,&DoNewL));} |
|
429 inline CPermanentFileStore* CPermanentFileStore::NewLC(RFile& aFile) |
|
430 /** Constructs a new permanent file store object in an already opened file and |
|
431 places the pointer onto the cleanup stack. |
|
432 |
|
433 The file must already be open before calling this function.The existing content |
|
434 of the file is discarded. |
|
435 |
|
436 Note that ownership of the file passes to the store. The referenced RFile |
|
437 is cleared and is no longer valid. |
|
438 |
|
439 @param aFile A reference to the opened file. |
|
440 @return A pointer to the new permanent file store object. */ |
|
441 {return STATIC_CAST(CPermanentFileStore*,CFileStore::NewLC(aFile,&DoNewL));} |
|
442 |
|
443 // Class RFilePagePool |
|
444 inline TInt RFilePagePool::Open(RFs& aFs,const TDesC& aName,TUint aFileMode) |
|
445 /** Opens a file to use for the page pool. |
|
446 |
|
447 @param aFs A file server session |
|
448 @param aName The name of the file |
|
449 @param aFileMode The mode in which the file is opened. For more information, |
|
450 see the TFileMode enumeration. |
|
451 @return KErrNone if successful, otherwise another of the system-wide error |
|
452 codes. |
|
453 @see TFileMode */ |
|
454 {return iFile.Open(aFs,aName,aFileMode);} |
|
455 inline TInt RFilePagePool::Create(RFs& aFs,const TDesC& aName,TUint aFileMode) |
|
456 /** Creates a new file for the page pool. |
|
457 |
|
458 @param aFs A file server session |
|
459 @param aName The name of the file. Any path components which are not specified |
|
460 here are taken from the session path. |
|
461 @param aFileMode The mode in which the file is opened. For more information |
|
462 see the TFileMode enumeration. |
|
463 @return KErrNone if successful, otherwise another of the system-wide error |
|
464 codes. |
|
465 @see TFileMode */ |
|
466 {return iFile.Create(aFs,aName,aFileMode);} |
|
467 inline TInt RFilePagePool::Replace(RFs& aFs,const TDesC& aName,TUint aFileMode) |
|
468 /** Creates or opens a file for the page pool. |
|
469 |
|
470 If there is an existing file with the same name, this function overwrites |
|
471 it. If the file does not already exist, it is created. |
|
472 |
|
473 @param aFs A file server session. |
|
474 @param aName The name of the file. Any path components which are not specified |
|
475 here are taken from the session path. |
|
476 @param aFileMode The mode in which the file is opened. For more information |
|
477 see the TFileMode enumeration. |
|
478 @return KErrNone if successful, otherwise another of the system-wide error |
|
479 codes. |
|
480 @see TFileMode */ |
|
481 {return iFile.Replace(aFs,aName,aFileMode);} |
|
482 inline TInt RFilePagePool::Temp(RFs& aFs,const TDesC& aPath,TFileName& aName,TUint aFileMode) |
|
483 /** Creates and opens a file for the page pool with a unique name. |
|
484 |
|
485 @param aFs A file server session. |
|
486 @param aPath The directory in which the file should be created. |
|
487 @param aName On return, contains the full path and name of the file. The filename |
|
488 is guaranteed to be unique within the directory specified by aPath. |
|
489 @param aFileMode The mode in which the file is opened. For more information |
|
490 see the TFileMode enumeration. |
|
491 @return KErrNone if successful, otherwise another of the system-wide error |
|
492 codes. */ |
|
493 {return iFile.Temp(aFs,aPath,aName,aFileMode);} |
|
494 inline void RFilePagePool::Attach(RFile& aFile) |
|
495 /** Sets an existing file to be used for the page pool. |
|
496 |
|
497 @param aFile File to use for the page pool */ |
|
498 {iFile=aFile;} |
|
499 inline void RFilePagePool::Detach() |
|
500 /** Ends the use of the file for the page pool, but does not close the file. */ |
|
501 {iFile=RFile();} |
|
502 inline RFile& RFilePagePool::File() const |
|
503 {return MUTABLE_CAST(RFile&,iFile);} |
|
504 |