persistentstorage/store/INC/S32FILE.INL
changeset 35 0d6db0a14001
parent 25 63532cdadd44
child 40 b8bdbc8f59c7
equal deleted inserted replaced
25:63532cdadd44 35:0d6db0a14001
   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 
   394 @param aName On return, contains the full path name of the new file.
   394 @param aName On return, contains the full path name of the new file.
   395 @param aFileMode The mode in which the file is to be accessed. The mode is 
   395 @param aFileMode The mode in which the file is to be accessed. The mode is 
   396 defined by the TFileMode type.
   396 defined by the TFileMode type.
   397 @return A pointer to the new permanent file store object.
   397 @return A pointer to the new permanent file store object.
   398 @see TFileMode */
   398 @see TFileMode */
   399 	{return STATIC_CAST(CPermanentFileStore*,CFileStore::TempL(aFs,aPath,aName,aFileMode,&DoNewL));}
   399 	{
       
   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,
       
   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.
       
   402 	return STATIC_CAST(CPermanentFileStore*,CFileStore::TempL(aFs,aPath,aName,aFileMode|EFileWriteDirectIO,&DoNewL));
       
   403 	}
   400 inline CPermanentFileStore* CPermanentFileStore::TempLC(RFs& aFs,const TDesC& aPath,TFileName& aName,TUint aFileMode)
   404 inline CPermanentFileStore* CPermanentFileStore::TempLC(RFs& aFs,const TDesC& aPath,TFileName& aName,TUint aFileMode)
   401 /** Creates a temporary file, constructs a permanent file store object to be associated 
   405 /** Creates a temporary file, constructs a permanent file store object to be associated 
   402 with it, and places the pointer onto the cleanup stack.
   406 with it, and places the pointer onto the cleanup stack.
   403 
   407 
   404 The new file is created in the specified path and a unique file name is generated 
   408 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.
   438 inline CPermanentFileStore* CPermanentFileStore::FromLC(RFile& aFile)
   444 inline CPermanentFileStore* CPermanentFileStore::FromLC(RFile& aFile)
   439 /** Constructs a permanent file store object from an already opened file, and places 
   445 /** Constructs a permanent file store object from an already opened file, and places 
   440 the pointer onto the cleanup stack.
   446 the pointer onto the cleanup stack.
   441 
   447 
   442 The file must already be open before calling this function. It is strongly recommended to set EFileWriteDirectIO
   448 The file must already be open before calling this function. It is strongly recommended to set EFileWriteDirectIO
   443 bit when opening the file. It is because that when the file cache in file server is on, the
   449 bit when opening the file. This is because that when the file server write caching is enabled, the
   444 order of file writing is not guaranteed which could cause data inconsistency in some
   450 order of file write operations is not guaranteed. This could cause data inconsistency in some
   445 circumstances, for example, when the power is lost in the middle of data transaction.
   451 circumstances, for example, when the power is lost in the middle of database transaction.
   446 Therefore, the file write cache should be switched off to maintain the file integrity.
   452 Therefore, the file write caching should be switched off to maintain integrity.
   447 
   453 
   448 Note that ownership of the file passes to the store. The referenced RFile 
   454 Note that ownership of the file passes to the store. The referenced RFile 
   449 is cleared and is no longer valid.
   455 is cleared and is no longer valid.
   450 
   456 
   451 @param aFile A reference to the opened file. 
   457 @param aFile A reference to the opened file. 
   454 inline CPermanentFileStore* CPermanentFileStore::NewL(RFile& aFile)
   460 inline CPermanentFileStore* CPermanentFileStore::NewL(RFile& aFile)
   455 /** Constructs a new permanent file store object in an already opened file.
   461 /** Constructs a new permanent file store object in an already opened file.
   456 
   462 
   457 The file must already be open before calling this function. The existing content 
   463 The file must already be open before calling this function. The existing content 
   458 of the file is discarded. It is strongly recommended to set EFileWriteDirectIO
   464 of the file is discarded. It is strongly recommended to set EFileWriteDirectIO
   459 bit when opening the file. It is because that when the file cache in file server is on, the
   465 bit when opening the file. It is because that when the file write caching in file server is on, the
   460 order of file writing is not guaranteed which could cause data inconsistency in some
   466 order of file writing is not guaranteed which could cause data inconsistency in some
   461 circumstances, for example, when the power is lost in the middle of data transaction.
   467 circumstances, for example, when the power is lost in the middle of data transaction.
   462 Therefore, the file write cache should be switched off to maintain the file integrity.
   468 Therefore, the file write caching should be switched off to maintain the file integrity.
   463 
   469 
   464 Note that ownership of the file passes to the store. The referenced RFile 
   470 Note that ownership of the file passes to the store. The referenced RFile 
   465 is cleared and is no longer valid.
   471 is cleared and is no longer valid.
   466 
   472 
   467 @param aFile A reference to the opened file. 
   473 @param aFile A reference to the opened file. 
   471 /** Constructs a new permanent file store object in an already opened file and 
   477 /** Constructs a new permanent file store object in an already opened file and 
   472 places the pointer onto the cleanup stack.
   478 places the pointer onto the cleanup stack.
   473 
   479 
   474 The file must already be open before calling this function.The existing content 
   480 The file must already be open before calling this function.The existing content 
   475 of the file is discarded. It is strongly recommended to set EFileWriteDirectIO
   481 of the file is discarded. It is strongly recommended to set EFileWriteDirectIO
   476 bit when opening the file. It is because that when the file cache in file server is on, the
   482 bit when opening the file. It is because that when the write caching in file server is on, the
   477 order of file writing is not guaranteed which could cause data inconsistency in some
   483 order of file writing is not guaranteed which could cause data inconsistency in some
   478 circumstances, for example, when the power is lost in the middle of data transaction.
   484 circumstances, for example, when the power is lost in the middle of data transaction.
   479 Therefore, the file write cache should be switched off to maintain the file integrity.
   485 Therefore, the file write caching should be switched off to maintain the file integrity.
   480 
   486 
   481 Note that ownership of the file passes to the store. The referenced RFile 
   487 Note that ownership of the file passes to the store. The referenced RFile 
   482 is cleared and is no longer valid.
   488 is cleared and is no longer valid.
   483 
   489 
   484 @param aFile A reference to the opened file. 
   490 @param aFile A reference to the opened file.