294 @return A pointer to the new permanent file store object. |
294 @return A pointer to the new permanent file store object. |
295 @see TFileMode */ |
295 @see TFileMode */ |
296 { |
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, |
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. |
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)); |
299 |
|
300 if ((aFileMode&EFileWrite) != 0) |
|
301 { |
|
302 aFileMode |= EFileWriteDirectIO; |
|
303 aFileMode &= (~EFileWriteBuffered); |
|
304 } |
|
305 return STATIC_CAST(CPermanentFileStore*,CFileStore::OpenL(aFs,aName,aFileMode,KPermanentFileStoreFactoryFunction)); |
300 } |
306 } |
301 inline CPermanentFileStore* CPermanentFileStore::OpenLC(RFs& aFs,const TDesC& aName,TUint aFileMode) |
307 inline CPermanentFileStore* CPermanentFileStore::OpenLC(RFs& aFs,const TDesC& aName,TUint aFileMode) |
302 /** Opens a file containing a permanent file store, constructs a permanent file |
308 /** Opens a file containing a permanent file store, constructs a permanent file |
303 store object, and places the pointer onto the cleanup stack. |
309 store object, and places the pointer onto the cleanup stack. |
304 |
310 |
309 @return A pointer to the new permanent file store object. |
315 @return A pointer to the new permanent file store object. |
310 @see TFileMode */ |
316 @see TFileMode */ |
311 { |
317 { |
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, |
318 // 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. |
319 // 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)); |
320 |
|
321 if ((aFileMode&EFileWrite) != 0) |
|
322 { |
|
323 aFileMode |= EFileWriteDirectIO; |
|
324 aFileMode &= (~EFileWriteBuffered); |
|
325 } |
|
326 return STATIC_CAST(CPermanentFileStore*,CFileStore::OpenLC(aFs,aName,aFileMode,KPermanentFileStoreFactoryFunction)); |
315 } |
327 } |
316 inline CPermanentFileStore* CPermanentFileStore::CreateL(RFs& aFs,const TDesC& aName,TUint aFileMode) |
328 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 |
329 /** Creates a new file and constructs a new permanent file store object to be associated |
318 with this file. |
330 with this file. |
319 |
331 |
325 @return A pointer to the new permanent file store object. |
337 @return A pointer to the new permanent file store object. |
326 @see TFileMode */ |
338 @see TFileMode */ |
327 { |
339 { |
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, |
340 // 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. |
341 // 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)); |
342 |
|
343 if ((aFileMode&EFileWrite) != 0) |
|
344 { |
|
345 aFileMode |= EFileWriteDirectIO; |
|
346 aFileMode &= (~EFileWriteBuffered); |
|
347 } |
|
348 return STATIC_CAST(CPermanentFileStore*,CFileStore::CreateL(aFs,aName,aFileMode,&DoNewL)); |
331 } |
349 } |
332 inline CPermanentFileStore* CPermanentFileStore::CreateLC(RFs& aFs,const TDesC& aName,TUint aFileMode) |
350 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 |
351 /** 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. |
352 with this file, and places the pointer onto the cleanup stack. |
335 |
353 |
341 @return A pointer to the new permanent file store object. |
359 @return A pointer to the new permanent file store object. |
342 @see TFileMode */ |
360 @see TFileMode */ |
343 { |
361 { |
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, |
362 // 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. |
363 // 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)); |
364 |
|
365 if ((aFileMode&EFileWrite) != 0) |
|
366 { |
|
367 aFileMode |= EFileWriteDirectIO; |
|
368 aFileMode &= (~EFileWriteBuffered); |
|
369 } |
|
370 return STATIC_CAST(CPermanentFileStore*,CFileStore::CreateLC(aFs,aName,aFileMode,&DoNewL)); |
347 } |
371 } |
348 inline CPermanentFileStore* CPermanentFileStore::ReplaceL(RFs& aFs,const TDesC& aName,TUint aFileMode) |
372 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 |
373 /** Creates a file, constructs a permanent file store object to be associated with |
350 it. |
374 it. |
351 |
375 |
358 @return A pointer to the new permanent file store object. |
382 @return A pointer to the new permanent file store object. |
359 @see TFileMode */ |
383 @see TFileMode */ |
360 { |
384 { |
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, |
385 // 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. |
386 // 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)); |
387 |
|
388 if ((aFileMode&EFileWrite) != 0) |
|
389 { |
|
390 aFileMode |= EFileWriteDirectIO; |
|
391 aFileMode &= (~EFileWriteBuffered); |
|
392 } |
|
393 return STATIC_CAST(CPermanentFileStore*,CFileStore::ReplaceL(aFs,aName,aFileMode,&DoNewL)); |
364 } |
394 } |
365 inline CPermanentFileStore* CPermanentFileStore::ReplaceLC(RFs& aFs,const TDesC& aName,TUint aFileMode) |
395 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 |
396 /** Creates a file, constructs a permanent file store object to be associated with |
367 it, and places the pointer onto the cleanup stack. |
397 it, and places the pointer onto the cleanup stack. |
368 |
398 |
375 @return A pointer to the new permanent file store object. |
405 @return A pointer to the new permanent file store object. |
376 @see TFileMode */ |
406 @see TFileMode */ |
377 { |
407 { |
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, |
408 // 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. |
409 // 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)); |
410 |
|
411 if ((aFileMode&EFileWrite) != 0) |
|
412 { |
|
413 aFileMode |= EFileWriteDirectIO; |
|
414 aFileMode &= (~EFileWriteBuffered); |
|
415 } |
|
416 return STATIC_CAST(CPermanentFileStore*,CFileStore::ReplaceLC(aFs,aName,aFileMode,&DoNewL)); |
381 } |
417 } |
382 inline CPermanentFileStore* CPermanentFileStore::TempL(RFs& aFs,const TDesC& aPath,TFileName& aName,TUint aFileMode) |
418 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 |
419 /** Creates a temporary file and constructs a permanent file store object to be |
384 associated with it. |
420 associated with it. |
385 |
421 |
397 @return A pointer to the new permanent file store object. |
433 @return A pointer to the new permanent file store object. |
398 @see TFileMode */ |
434 @see TFileMode */ |
399 { |
435 { |
400 // 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, |
436 // 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, |
401 // 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. |
437 // 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. |
402 return STATIC_CAST(CPermanentFileStore*,CFileStore::TempL(aFs,aPath,aName,aFileMode|EFileWriteDirectIO,&DoNewL)); |
438 |
|
439 if ((aFileMode&EFileWrite) != 0) |
|
440 { |
|
441 aFileMode |= EFileWriteDirectIO; |
|
442 aFileMode &= (~EFileWriteBuffered); |
|
443 } |
|
444 return STATIC_CAST(CPermanentFileStore*,CFileStore::TempL(aFs,aPath,aName,aFileMode,&DoNewL)); |
403 } |
445 } |
404 inline CPermanentFileStore* CPermanentFileStore::TempLC(RFs& aFs,const TDesC& aPath,TFileName& aName,TUint aFileMode) |
446 inline CPermanentFileStore* CPermanentFileStore::TempLC(RFs& aFs,const TDesC& aPath,TFileName& aName,TUint aFileMode) |
405 /** Creates a temporary file, constructs a permanent file store object to be associated |
447 /** Creates a temporary file, constructs a permanent file store object to be associated |
406 with it, and places the pointer onto the cleanup stack. |
448 with it, and places the pointer onto the cleanup stack. |
407 |
449 |
419 @return A pointer to the new permanent file store object. |
461 @return A pointer to the new permanent file store object. |
420 @see TFileMode */ |
462 @see TFileMode */ |
421 { |
463 { |
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, |
464 // 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. |
465 // 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)); |
466 |
|
467 if ((aFileMode&EFileWrite) != 0) |
|
468 { |
|
469 aFileMode |= EFileWriteDirectIO; |
|
470 aFileMode &= (~EFileWriteBuffered); |
|
471 } |
|
472 return STATIC_CAST(CPermanentFileStore*,CFileStore::TempLC(aFs,aPath,aName,aFileMode,&DoNewL)); |
425 } |
473 } |
426 inline CPermanentFileStore* CPermanentFileStore::FromL(RFile& aFile) |
474 inline CPermanentFileStore* CPermanentFileStore::FromL(RFile& aFile) |
427 /** Constructs a permanent file store object from an already opened file. It is strongly recommended to set EFileWriteDirectIO |
475 /** Constructs a permanent file store object from an already opened file. It is strongly recommended to set EFileWriteDirectIO |
428 bit when opening the file. This is because that when the file server write caching is enabled, the |
476 bit when opening the file. This is because that when the file server write caching is enabled, the |
429 order of file write operations is not guaranteed. This could cause data inconsistency in some |
477 order of file write operations is not guaranteed. This could cause data inconsistency in some |