persistentstorage/store/INC/S32FILE.INL
branchRCL_3
changeset 16 b6ab70c1385f
parent 0 08ec8eefde2f
child 21 28839de615b4
equal deleted inserted replaced
15:fcc16690f446 16:b6ab70c1385f
   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.
   293 defined by the TFileMode type. 
   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 	{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 	}
   297 inline CPermanentFileStore* CPermanentFileStore::OpenLC(RFs& aFs,const TDesC& aName,TUint aFileMode)
   301 inline CPermanentFileStore* CPermanentFileStore::OpenLC(RFs& aFs,const TDesC& aName,TUint aFileMode)
   298 /** 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 
   299 store object, and places the pointer onto the cleanup stack.
   303 store object, and places the pointer onto the cleanup stack.
   300 
   304 
   301 @param aFs Handle to a file server session. 
   305 @param aFs Handle to a file server session. 
   302 @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. 
   303 @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 
   304 defined by the TFileMode type.
   308 defined by the TFileMode type. 
   305 @return A pointer to the new permanent file store object.
   309 @return A pointer to the new permanent file store object.
   306 @see TFileMode */
   310 @see TFileMode */
   307 	{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 	}
   308 inline CPermanentFileStore* CPermanentFileStore::CreateL(RFs& aFs,const TDesC& aName,TUint aFileMode)
   316 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 
   317 /** Creates a new file and constructs a new permanent file store object to be associated 
   310 with this file.
   318 with this file.
   311 
   319 
   312 @param aFs Handle to a file server session.
   320 @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 
   321 @param aName The full path name of the new file. A file with this name must 
   314 not already exist, otherwise the function leaves.
   322 not already exist, otherwise the function leaves.
   315 @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 
   316 is defined by the TFileMode type.
   324 is defined by the TFileMode type. 
   317 @return A pointer to the new permanent file store object.
   325 @return A pointer to the new permanent file store object.
   318 @see TFileMode */
   326 @see TFileMode */
   319 	{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 	}
   320 inline CPermanentFileStore* CPermanentFileStore::CreateLC(RFs& aFs,const TDesC& aName,TUint aFileMode)
   332 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 
   333 /** 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.
   334 with this file, and places the pointer onto the cleanup stack.
   323 
   335 
   324 @param aFs Handle to a file server session. 
   336 @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 
   337 @param aName The full path name of the new file. A file with this name must 
   326 not already exist, otherwise the function leaves.
   338 not already exist, otherwise the function leaves.
   327 @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 
   328 is defined by the TFileMode type.
   340 is defined by the TFileMode type. 
   329 @return A pointer to the new permanent file store object. 
   341 @return A pointer to the new permanent file store object. 
   330 @see TFileMode */
   342 @see TFileMode */
   331 	{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 	}
   332 inline CPermanentFileStore* CPermanentFileStore::ReplaceL(RFs& aFs,const TDesC& aName,TUint aFileMode)
   348 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 
   349 /** Creates a file, constructs a permanent file store object to be associated with 
   334 it.
   350 it.
   335 
   351 
   336 This file replaces any existing file of the same name.
   352 This file replaces any existing file of the same name.
   337 
   353 
   338 @param aFs Handle to a file server session. 
   354 @param aFs Handle to a file server session. 
   339 @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.
   340 @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 
   341 defined by the TFileMode type.
   357 defined by the TFileMode type. 
   342 @return A pointer to the new permanent file store object.
   358 @return A pointer to the new permanent file store object.
   343 @see TFileMode */
   359 @see TFileMode */
   344 	{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 	}
   345 inline CPermanentFileStore* CPermanentFileStore::ReplaceLC(RFs& aFs,const TDesC& aName,TUint aFileMode)
   365 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 
   366 /** Creates a file, constructs a permanent file store object to be associated with 
   347 it, and places the pointer onto the cleanup stack.
   367 it, and places the pointer onto the cleanup stack.
   348 
   368 
   349 This file replaces any existing file of the same name.
   369 This file replaces any existing file of the same name.
   350 
   370 
   351 @param aFs Handle to a file server session. 
   371 @param aFs Handle to a file server session. 
   352 @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.
   353 @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 
   354 defined by the TFileMode type.
   374 defined by the TFileMode type. 
   355 @return A pointer to the new permanent file store object. 
   375 @return A pointer to the new permanent file store object. 
   356 @see TFileMode */
   376 @see TFileMode */
   357 	{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 	}
   358 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)
   359 /** 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 
   360 associated with it.
   384 associated with it.
   361 
   385 
   362 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 
   370 @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.
   371 @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 
   372 defined by the TFileMode type.
   396 defined by the TFileMode type.
   373 @return A pointer to the new permanent file store object.
   397 @return A pointer to the new permanent file store object.
   374 @see TFileMode */
   398 @see TFileMode */
   375 	{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 	}
   376 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)
   377 /** 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 
   378 with it, and places the pointer onto the cleanup stack.
   406 with it, and places the pointer onto the cleanup stack.
   379 
   407 
   380 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 
   385 
   413 
   386 @param aFs Handle to a file server session. 
   414 @param aFs Handle to a file server session. 
   387 @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.
   388 @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.
   389 @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 
   390 defined by the TFileMode type.
   418 defined by the TFileMode type. 
   391 @return A pointer to the new permanent file store object.
   419 @return A pointer to the new permanent file store object.
   392 @see TFileMode */
   420 @see TFileMode */
   393 	{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 	}
   394 inline CPermanentFileStore* CPermanentFileStore::FromL(RFile& aFile)
   426 inline CPermanentFileStore* CPermanentFileStore::FromL(RFile& aFile)
   395 /** Constructs a permanent file store object from an already opened file.
   427 /** 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
       
   429 order of file write operations is not guaranteed. This could cause data inconsistency in some
       
   430 circumstances, for example, when the power is lost in the middle of database transaction.
       
   431 Therefore, the file write caching should be switched off to maintain integrity.
   396 
   432 
   397 The file must already be open before calling this function.
   433 The file must already be open before calling this function.
   398 
   434 
   399 Note that ownership of the file passes to the store. The referenced RFile 
   435 Note that ownership of the file passes to the store. The referenced RFile 
   400 is cleared and is no longer valid.
   436 is cleared and is no longer valid.
       
   437 
   401 
   438 
   402 @param aFile A reference to the opened file. 
   439 @param aFile A reference to the opened file. 
   403 @return A pointer to the new permanent file store object. */
   440 @return A pointer to the new permanent file store object. */
   404 	{return STATIC_CAST(CPermanentFileStore*,CFileStore::FromL(aFile,KPermanentFileStoreFactoryFunction));}
   441 	{return STATIC_CAST(CPermanentFileStore*,CFileStore::FromL(aFile,KPermanentFileStoreFactoryFunction));}
   405 inline CPermanentFileStore* CPermanentFileStore::FromLC(RFile& aFile)
   442 inline CPermanentFileStore* CPermanentFileStore::FromLC(RFile& aFile)
   406 /** Constructs a permanent file store object from an already opened file, and places 
   443 /** Constructs a permanent file store object from an already opened file, and places 
   407 the pointer onto the cleanup stack.
   444 the pointer onto the cleanup stack.
   408 
   445 
   409 The file must already be open before calling this function.
   446 The file must already be open before calling this function. It is strongly recommended to set EFileWriteDirectIO
       
   447 bit when opening the file. This is because that when the file server write caching is enabled, the
       
   448 order of file write operations is not guaranteed. This could cause data inconsistency in some
       
   449 circumstances, for example, when the power is lost in the middle of database transaction.
       
   450 Therefore, the file write caching should be switched off to maintain integrity.
   410 
   451 
   411 Note that ownership of the file passes to the store. The referenced RFile 
   452 Note that ownership of the file passes to the store. The referenced RFile 
   412 is cleared and is no longer valid.
   453 is cleared and is no longer valid.
   413 
   454 
   414 @param aFile A reference to the opened file. 
   455 @param aFile A reference to the opened file. 
   416 	{return STATIC_CAST(CPermanentFileStore*,CFileStore::FromLC(aFile,KPermanentFileStoreFactoryFunction));}
   457 	{return STATIC_CAST(CPermanentFileStore*,CFileStore::FromLC(aFile,KPermanentFileStoreFactoryFunction));}
   417 inline CPermanentFileStore* CPermanentFileStore::NewL(RFile& aFile)
   458 inline CPermanentFileStore* CPermanentFileStore::NewL(RFile& aFile)
   418 /** Constructs a new permanent file store object in an already opened file.
   459 /** Constructs a new permanent file store object in an already opened file.
   419 
   460 
   420 The file must already be open before calling this function. The existing content 
   461 The file must already be open before calling this function. The existing content 
   421 of the file is discarded.
   462 of the file is discarded. It is strongly recommended to set EFileWriteDirectIO
       
   463 bit when opening the file. It is because that when file server file write cachingis on, the
       
   464 order of file writing is not guaranteed which could cause data inconsistency in some
       
   465 circumstances, for example, when the power is lost in the middle of data transaction.
       
   466 Therefore, the file write caching should be switched off to maintain the file integrity.
   422 
   467 
   423 Note that ownership of the file passes to the store. The referenced RFile 
   468 Note that ownership of the file passes to the store. The referenced RFile 
   424 is cleared and is no longer valid.
   469 is cleared and is no longer valid.
   425 
   470 
   426 @param aFile A reference to the opened file. 
   471 @param aFile A reference to the opened file. 
   429 inline CPermanentFileStore* CPermanentFileStore::NewLC(RFile& aFile)
   474 inline CPermanentFileStore* CPermanentFileStore::NewLC(RFile& aFile)
   430 /** Constructs a new permanent file store object in an already opened file and 
   475 /** Constructs a new permanent file store object in an already opened file and 
   431 places the pointer onto the cleanup stack.
   476 places the pointer onto the cleanup stack.
   432 
   477 
   433 The file must already be open before calling this function.The existing content 
   478 The file must already be open before calling this function.The existing content 
   434 of the file is discarded.
   479 of the file is discarded. It is strongly recommended to set EFileWriteDirectIO
       
   480 bit when opening the file. It is because that when the file write caching in file server is on, the
       
   481 order of file writing is not guaranteed which could cause data inconsistency in some
       
   482 circumstances, for example, when the power is lost in the middle of data transaction.
       
   483 Therefore, the file file write caching should be switched off to maintain the file integrity.
   435 
   484 
   436 Note that ownership of the file passes to the store. The referenced RFile 
   485 Note that ownership of the file passes to the store. The referenced RFile 
   437 is cleared and is no longer valid.
   486 is cleared and is no longer valid.
   438 
   487 
   439 @param aFile A reference to the opened file. 
   488 @param aFile A reference to the opened file.