288 file store object. |
288 file store object. |
289 |
289 |
290 @param aFs Handle to a file server session. |
290 @param aFs Handle to a file server session. |
291 @param aName The full path name of the file containing the store. |
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 |
292 @param aFileMode The mode in which the file is to be accessed. The mode is |
293 defined by the TFileMode type. It is strongly recommended to set EFileWriteDirectIO |
293 defined by the TFileMode type. |
294 bit. It is because that When the file cache in file server is on, the |
|
295 order of file writing is not guaranteed which could cause data inconsistency in some |
|
296 circumstances, for example, when the power is lost in the middle of data transaction. |
|
297 Therefore, the file write cache should be switched off to maintain the file integrity. |
|
298 @return A pointer to the new permanent file store object. |
294 @return A pointer to the new permanent file store object. |
299 @see TFileMode */ |
295 @see TFileMode */ |
300 {return STATIC_CAST(CPermanentFileStore*,CFileStore::OpenL(aFs,aName,aFileMode,KPermanentFileStoreFactoryFunction));} |
296 { |
|
297 // When the file server write caching is enabled, the order of file write operations is not guaranteed. This could cause data inconsistency in some circumstances, |
|
298 // for example, when the power is lost in the middle of a database transaction. Therefore, the file write caching is disabled for this file to maintain integrity. |
|
299 return STATIC_CAST(CPermanentFileStore*,CFileStore::OpenL(aFs,aName,aFileMode|EFileWriteDirectIO,KPermanentFileStoreFactoryFunction)); |
|
300 } |
301 inline CPermanentFileStore* CPermanentFileStore::OpenLC(RFs& aFs,const TDesC& aName,TUint aFileMode) |
301 inline CPermanentFileStore* CPermanentFileStore::OpenLC(RFs& aFs,const TDesC& aName,TUint aFileMode) |
302 /** Opens a file containing a permanent file store, constructs a permanent file |
302 /** Opens a file containing a permanent file store, constructs a permanent file |
303 store object, and places the pointer onto the cleanup stack. |
303 store object, and places the pointer onto the cleanup stack. |
304 |
304 |
305 @param aFs Handle to a file server session. |
305 @param aFs Handle to a file server session. |
306 @param aName The full path name of the file containing the store. |
306 @param aName The full path name of the file containing the store. |
307 @param aFileMode The mode in which the file is to be accessed. The mode is |
307 @param aFileMode The mode in which the file is to be accessed. The mode is |
308 defined by the TFileMode type. It is strongly recommended to set EFileWriteDirectIO |
308 defined by the TFileMode type. |
309 bit. It is because that When the file cache in file server is on, the |
|
310 order of file writing is not guaranteed which could cause data inconsistency in some |
|
311 circumstances, for example, when the power is lost in the middle of data transaction. |
|
312 Therefore, the file write cache should be switched off to maintain the file integrity. |
|
313 @return A pointer to the new permanent file store object. |
309 @return A pointer to the new permanent file store object. |
314 @see TFileMode */ |
310 @see TFileMode */ |
315 {return STATIC_CAST(CPermanentFileStore*,CFileStore::OpenLC(aFs,aName,aFileMode,KPermanentFileStoreFactoryFunction));} |
311 { |
|
312 // When the file server write caching is enabled, the order of file write operations is not guaranteed. This could cause data inconsistency in some circumstances, |
|
313 // for example, when the power is lost in the middle of a database transaction. Therefore, the file write caching is disabled for this file to maintain integrity. |
|
314 return STATIC_CAST(CPermanentFileStore*,CFileStore::OpenLC(aFs,aName,aFileMode|EFileWriteDirectIO,KPermanentFileStoreFactoryFunction)); |
|
315 } |
316 inline CPermanentFileStore* CPermanentFileStore::CreateL(RFs& aFs,const TDesC& aName,TUint aFileMode) |
316 inline CPermanentFileStore* CPermanentFileStore::CreateL(RFs& aFs,const TDesC& aName,TUint aFileMode) |
317 /** Creates a new file and constructs a new permanent file store object to be associated |
317 /** Creates a new file and constructs a new permanent file store object to be associated |
318 with this file. |
318 with this file. |
319 |
319 |
320 @param aFs Handle to a file server session. |
320 @param aFs Handle to a file server session. |
321 @param aName The full path name of the new file. A file with this name must |
321 @param aName The full path name of the new file. A file with this name must |
322 not already exist, otherwise the function leaves. |
322 not already exist, otherwise the function leaves. |
323 @param aFileMode The mode in which the new file is to be accessed. This mode |
323 @param aFileMode The mode in which the new file is to be accessed. This mode |
324 is defined by the TFileMode type. It is strongly recommended to set EFileWriteDirectIO |
324 is defined by the TFileMode type. |
325 bit. It is because that When the file cache in file server is on, the |
|
326 order of file writing is not guaranteed which could cause data inconsistency in some |
|
327 circumstances, for example, when the power is lost in the middle of data transaction. |
|
328 Therefore, the file write cache should be switched off to maintain the file integrity. |
|
329 @return A pointer to the new permanent file store object. |
325 @return A pointer to the new permanent file store object. |
330 @see TFileMode */ |
326 @see TFileMode */ |
331 {return STATIC_CAST(CPermanentFileStore*,CFileStore::CreateL(aFs,aName,aFileMode,&DoNewL));} |
327 { |
|
328 // When the file server write caching is enabled, the order of file write operations is not guaranteed. This could cause data inconsistency in some circumstances, |
|
329 // for example, when the power is lost in the middle of a database transaction. Therefore, the file write caching is disabled for this file to maintain integrity. |
|
330 return STATIC_CAST(CPermanentFileStore*,CFileStore::CreateL(aFs,aName,aFileMode|EFileWriteDirectIO,&DoNewL)); |
|
331 } |
332 inline CPermanentFileStore* CPermanentFileStore::CreateLC(RFs& aFs,const TDesC& aName,TUint aFileMode) |
332 inline CPermanentFileStore* CPermanentFileStore::CreateLC(RFs& aFs,const TDesC& aName,TUint aFileMode) |
333 /** Creates a new file and constructs a new permanent file store object to be associated |
333 /** Creates a new file and constructs a new permanent file store object to be associated |
334 with this file, and places the pointer onto the cleanup stack. |
334 with this file, and places the pointer onto the cleanup stack. |
335 |
335 |
336 @param aFs Handle to a file server session. |
336 @param aFs Handle to a file server session. |
337 @param aName The full path name of the new file. A file with this name must |
337 @param aName The full path name of the new file. A file with this name must |
338 not already exist, otherwise the function leaves. |
338 not already exist, otherwise the function leaves. |
339 @param aFileMode The mode in which the new file is to be accessed. This mode |
339 @param aFileMode The mode in which the new file is to be accessed. This mode |
340 is defined by the TFileMode type. It is strongly recommended to set EFileWriteDirectIO |
340 is defined by the TFileMode type. |
341 bit. It is because that when the file cache in file server is on, the |
|
342 order of file writing is not guaranteed which could cause data inconsistency in some |
|
343 circumstances, for example, when the power is lost in the middle of data transaction. |
|
344 Therefore, the file write cache should be switched off to maintain the file integrity. |
|
345 @return A pointer to the new permanent file store object. |
341 @return A pointer to the new permanent file store object. |
346 @see TFileMode */ |
342 @see TFileMode */ |
347 {return STATIC_CAST(CPermanentFileStore*,CFileStore::CreateLC(aFs,aName,aFileMode,&DoNewL));} |
343 { |
|
344 // When the file server write caching is enabled, the order of file write operations is not guaranteed. This could cause data inconsistency in some circumstances, |
|
345 // for example, when the power is lost in the middle of a database transaction. Therefore, the file write caching is disabled for this file to maintain integrity. |
|
346 return STATIC_CAST(CPermanentFileStore*,CFileStore::CreateLC(aFs,aName,aFileMode|EFileWriteDirectIO,&DoNewL)); |
|
347 } |
348 inline CPermanentFileStore* CPermanentFileStore::ReplaceL(RFs& aFs,const TDesC& aName,TUint aFileMode) |
348 inline CPermanentFileStore* CPermanentFileStore::ReplaceL(RFs& aFs,const TDesC& aName,TUint aFileMode) |
349 /** Creates a file, constructs a permanent file store object to be associated with |
349 /** Creates a file, constructs a permanent file store object to be associated with |
350 it. |
350 it. |
351 |
351 |
352 This file replaces any existing file of the same name. |
352 This file replaces any existing file of the same name. |
353 |
353 |
354 @param aFs Handle to a file server session. |
354 @param aFs Handle to a file server session. |
355 @param aName The full path name of the file to be replaced. |
355 @param aName The full path name of the file to be replaced. |
356 @param aFileMode The mode in which the file is to be accessed. The mode is |
356 @param aFileMode The mode in which the file is to be accessed. The mode is |
357 defined by the TFileMode type. It is strongly recommended to set EFileWriteDirectIO |
357 defined by the TFileMode type. |
358 bit. It is because that when the file cache in file server is on, the |
|
359 order of file writing is not guaranteed which could cause data inconsistency in some |
|
360 circumstances, for example, when the power is lost in the middle of data transaction. |
|
361 Therefore, the file write cache should be switched off to maintain the file integrity. |
|
362 @return A pointer to the new permanent file store object. |
358 @return A pointer to the new permanent file store object. |
363 @see TFileMode */ |
359 @see TFileMode */ |
364 {return STATIC_CAST(CPermanentFileStore*,CFileStore::ReplaceL(aFs,aName,aFileMode,&DoNewL));} |
360 { |
|
361 // When the file server write caching is enabled, the order of file write operations is not guaranteed. This could cause data inconsistency in some circumstances, |
|
362 // for example, when the power is lost in the middle of a database transaction. Therefore, the file write caching is disabled for this file to maintain integrity. |
|
363 return STATIC_CAST(CPermanentFileStore*,CFileStore::ReplaceL(aFs,aName,aFileMode|EFileWriteDirectIO,&DoNewL)); |
|
364 } |
365 inline CPermanentFileStore* CPermanentFileStore::ReplaceLC(RFs& aFs,const TDesC& aName,TUint aFileMode) |
365 inline CPermanentFileStore* CPermanentFileStore::ReplaceLC(RFs& aFs,const TDesC& aName,TUint aFileMode) |
366 /** Creates a file, constructs a permanent file store object to be associated with |
366 /** Creates a file, constructs a permanent file store object to be associated with |
367 it, and places the pointer onto the cleanup stack. |
367 it, and places the pointer onto the cleanup stack. |
368 |
368 |
369 This file replaces any existing file of the same name. |
369 This file replaces any existing file of the same name. |
370 |
370 |
371 @param aFs Handle to a file server session. |
371 @param aFs Handle to a file server session. |
372 @param aName The full path name of the file to be replaced. |
372 @param aName The full path name of the file to be replaced. |
373 @param aFileMode The mode in which the file is to be accessed. The mode is |
373 @param aFileMode The mode in which the file is to be accessed. The mode is |
374 defined by the TFileMode type. It is strongly recommended to set EFileWriteDirectIO |
374 defined by the TFileMode type. |
375 bit. It is because that when the file cache in file server is on, the |
|
376 order of file writing is not guaranteed which could cause data inconsistency in some |
|
377 circumstances, for example, when the power is lost in the middle of data transaction. |
|
378 Therefore, the file write cache should be switched off to maintain the file integrity. |
|
379 @return A pointer to the new permanent file store object. |
375 @return A pointer to the new permanent file store object. |
380 @see TFileMode */ |
376 @see TFileMode */ |
381 {return STATIC_CAST(CPermanentFileStore*,CFileStore::ReplaceLC(aFs,aName,aFileMode,&DoNewL));} |
377 { |
|
378 // When the file server write caching is enabled, the order of file write operations is not guaranteed. This could cause data inconsistency in some circumstances, |
|
379 // for example, when the power is lost in the middle of a database transaction. Therefore, the file write caching is disabled for this file to maintain integrity. |
|
380 return STATIC_CAST(CPermanentFileStore*,CFileStore::ReplaceLC(aFs,aName,aFileMode|EFileWriteDirectIO,&DoNewL)); |
|
381 } |
382 inline CPermanentFileStore* CPermanentFileStore::TempL(RFs& aFs,const TDesC& aPath,TFileName& aName,TUint aFileMode) |
382 inline CPermanentFileStore* CPermanentFileStore::TempL(RFs& aFs,const TDesC& aPath,TFileName& aName,TUint aFileMode) |
383 /** Creates a temporary file and constructs a permanent file store object to be |
383 /** Creates a temporary file and constructs a permanent file store object to be |
384 associated with it. |
384 associated with it. |
385 |
385 |
386 The new file is created in the specified path and a unique file name is generated |
386 The new file is created in the specified path and a unique file name is generated |
409 |
413 |
410 @param aFs Handle to a file server session. |
414 @param aFs Handle to a file server session. |
411 @param aPath The path where the new file is to be created. |
415 @param aPath The path where the new file is to be created. |
412 @param aName On return, contains the full path name of the new file. |
416 @param aName On return, contains the full path name of the new file. |
413 @param aFileMode The mode in which the file is to be accessed. The mode is |
417 @param aFileMode The mode in which the file is to be accessed. The mode is |
414 defined by the TFileMode type. It is strongly recommended to set EFileWriteDirectIO |
418 defined by the TFileMode type. |
415 bit. It is because that When the file cache in file server is on, the |
|
416 order of file writing is not guaranteed which could cause data inconsistency in some |
|
417 circumstances, for example, when the power is lost in the middle of data transaction. |
|
418 Therefore, the file write cache should be switched off to maintain the file integrity. |
|
419 @return A pointer to the new permanent file store object. |
419 @return A pointer to the new permanent file store object. |
420 @see TFileMode */ |
420 @see TFileMode */ |
421 {return STATIC_CAST(CPermanentFileStore*,CFileStore::TempLC(aFs,aPath,aName,aFileMode,&DoNewL));} |
421 { |
|
422 // When the file server write caching is enabled, the order of file write operations is not guaranteed. This could cause data inconsistency in some circumstances, |
|
423 // for example, when the power is lost in the middle of a database transaction. Therefore, the file write caching is disabled for this file to maintain integrity. |
|
424 return STATIC_CAST(CPermanentFileStore*,CFileStore::TempLC(aFs,aPath,aName,aFileMode|EFileWriteDirectIO,&DoNewL)); |
|
425 } |
422 inline CPermanentFileStore* CPermanentFileStore::FromL(RFile& aFile) |
426 inline CPermanentFileStore* CPermanentFileStore::FromL(RFile& aFile) |
423 /** Constructs a permanent file store object from an already opened file. It is strongly recommended to set EFileWriteDirectIO |
427 /** Constructs a permanent file store object from an already opened file. It is strongly recommended to set EFileWriteDirectIO |
424 bit when opening the file. It is because that when the file cache in file server is on, the |
428 bit when opening the file. This is because that when the file server write caching is enabled, the |
425 order of file writing is not guaranteed which could cause data inconsistency in some |
429 order of file write operations is not guaranteed. This could cause data inconsistency in some |
426 circumstances, for example, when the power is lost in the middle of data transaction. |
430 circumstances, for example, when the power is lost in the middle of database transaction. |
427 Therefore, the file write cache should be switched off to maintain the file integrity. |
431 Therefore, the file write caching should be switched off to maintain integrity. |
|
432 |
|
433 |
428 |
434 |
429 The file must already be open before calling this function. |
435 The file must already be open before calling this function. |
430 |
436 |
431 Note that ownership of the file passes to the store. The referenced RFile |
437 Note that ownership of the file passes to the store. The referenced RFile |
432 is cleared and is no longer valid. |
438 is cleared and is no longer valid. |