#include <s32file.h>
class CPermanentFileStore : public CFileStore |
Public Member Functions | |
---|---|
CPermanentFileStore(RFile &) | |
CPermanentFileStore(RFileBuf &, const TUidType &) | |
~CPermanentFileStore() | |
CPermanentFileStore * | CreateL(RFs &, const TDesC &, TUint) |
CPermanentFileStore * | CreateLC(RFs &, const TDesC &, TUint) |
CPermanentFileStore * | FromL(RFile &) |
CPermanentFileStore * | FromLC(RFile &) |
virtual IMPORT_C TUid | Layout() |
IMPORT_C void | MarshalL() |
CPermanentFileStore * | NewL(RFile &) |
CPermanentFileStore * | NewLC(RFile &) |
CPermanentFileStore * | OpenL(RFs &, const TDesC &, TUint) |
CPermanentFileStore * | OpenLC(RFs &, const TDesC &, TUint) |
CPermanentFileStore * | ReplaceL(RFs &, const TDesC &, TUint) |
CPermanentFileStore * | ReplaceLC(RFs &, const TDesC &, TUint) |
CPermanentFileStore * | TempL(RFs &, const TDesC &, TFileName &, TUint) |
CPermanentFileStore * | TempLC(RFs &, const TDesC &, TFileName &, TUint) |
Protected Member Functions | |
---|---|
virtual IMPORT_C MStreamBuf * | DoCreateL(TStreamId &) |
virtual IMPORT_C MStreamBuf * | DoReadL(TStreamId) |
virtual IMPORT_C MStreamBuf * | DoReplaceL(TStreamId) |
virtual IMPORT_C MStreamBuf * | DoWriteL(TStreamId) |
Inherited Attributes | |
---|---|
CPersistentStore::iRoot |
Inherited Type Definitions | |
---|---|
CFileStore::TNewFunction |
Permanent file store.
This type of store supports full manipulation of store contents. Existing streams within this type of store can be changed.
IMPORT_C | ~CPermanentFileStore | ( | ) |
Frees resources owned by the object, prior to its destruction.
CPermanentFileStore * | CreateL | ( | RFs & | aFs, |
const TDesC & | aName, | |||
TUint | aFileMode | |||
) | [static, inline] |
Creates a new file and constructs a new permanent file store object to be associated with this file.
See also: TFileMode
Parameter | Description |
---|---|
aFs | Handle to a file server session. |
aName | The full path name of the new file. A file with this name must not already exist, otherwise the function leaves. |
aFileMode | The mode in which the new file is to be accessed. This mode is defined by the TFileMode type. |
Returns: A pointer to the new permanent file store object.
CPermanentFileStore * | CreateLC | ( | RFs & | aFs, |
const TDesC & | aName, | |||
TUint | aFileMode | |||
) | [static, inline] |
Creates a new file and constructs a new permanent file store object to be associated with this file, and places the pointer onto the cleanup stack.
See also: TFileMode
Parameter | Description |
---|---|
aFs | Handle to a file server session. |
aName | The full path name of the new file. A file with this name must not already exist, otherwise the function leaves. |
aFileMode | The mode in which the new file is to be accessed. This mode is defined by the TFileMode type. |
Returns: A pointer to the new permanent file store object.
IMPORT_C MStreamBuf * | DoCreateL | ( | TStreamId & | anId | ) | [protected, virtual] |
Reimplemented from CStreamStore::DoCreateL(TStreamId &)
Creates a new stream in the store. The function gets the allocated stream id in the anId parameter. A stream buffer for the stream should be returned, ready to write into the new stream. This provides the implementation for the RStoreWriteStream::CreateL() functions.
Parameter | Description |
---|---|
anId | On return, contains the allocated stream id. |
Returns: The stream buffer to be written to.
IMPORT_C MStreamBuf * | DoReadL | ( | TStreamId | anId | ) | const [protected, virtual] |
Reimplemented from CStreamStore::DoReadL(TStreamId)const
Opens the requested stream for reading. The function should return a stream buffer positioned at the beginning of this stream.
This function is called by the OpenL() and OpenLC() member functions of RStoreReadStream.
See also: RStoreReadStream::OpenL() RStoreReadStream::OpenLC()
Parameter | Description |
---|---|
anId | The stream to be read. |
Returns: A stream buffer positioned at the beginning of the stream to be read.
IMPORT_C MStreamBuf * | DoReplaceL | ( | TStreamId | anId | ) | [protected, virtual] |
Reimplemented from CStreamStore::DoReplaceL(TStreamId)
IMPORT_C MStreamBuf * | DoWriteL | ( | TStreamId | anId | ) | [protected, virtual] |
Reimplemented from CStreamStore::DoWriteL(TStreamId)
CPermanentFileStore * | FromL | ( | RFile & | aFile | ) | [static, inline] |
Reimplemented from CFileStore::FromL(RFile &)
Constructs a permanent file store object from an already opened file. It is strongly recommended to set EFileWriteDirectIO bit when opening the file. This is because that 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, for example, when the power is lost in the middle of database transaction. Therefore, the file write caching should be switched off to maintain integrity.
The file must already be open before calling this function.
Note that ownership of the file passes to the store. The referenced RFile is cleared and is no longer valid.
Parameter | Description |
---|---|
aFile | A reference to the opened file. |
Returns: A pointer to the new permanent file store object.
CPermanentFileStore * | FromLC | ( | RFile & | aFile | ) | [static, inline] |
Reimplemented from CFileStore::FromLC(RFile &)
Constructs a permanent file store object from an already opened file, and places the pointer onto the cleanup stack.
The file must already be open before calling this function. It is strongly recommended to set EFileWriteDirectIO bit when opening the file. This is because that 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, for example, when the power is lost in the middle of database transaction. Therefore, the file write caching should be switched off to maintain integrity.
Note that ownership of the file passes to the store. The referenced RFile is cleared and is no longer valid.
Parameter | Description |
---|---|
aFile | A reference to the opened file. |
Returns: A pointer to the new permanent file store object.
IMPORT_C TUid | Layout | ( | ) | const [virtual] |
Reimplemented from CFileStore::Layout()const
Gets the UID that uniquely identifies this file store as a permanent file store.
Returns: KPermanentFileStoreLayoutUid.
CPermanentFileStore * | NewL | ( | RFile & | aFile | ) | [static, inline] |
Constructs a new permanent file store object in an already opened file.
The file must already be open before calling this function. The existing content of the file is discarded. It is strongly recommended to set EFileWriteDirectIO bit when opening the file. It is because that when file server file write cachingis on, the order of file writing is not guaranteed which could cause data inconsistency in some circumstances, for example, when the power is lost in the middle of data transaction. Therefore, the file write caching should be switched off to maintain the file integrity.
Note that ownership of the file passes to the store. The referenced RFile is cleared and is no longer valid.
Parameter | Description |
---|---|
aFile | A reference to the opened file. |
Returns: A pointer to the new permanent file store object.
CPermanentFileStore * | NewLC | ( | RFile & | aFile | ) | [static, inline] |
Constructs a new permanent file store object in an already opened file and places the pointer onto the cleanup stack.
The file must already be open before calling this function.The existing content of the file is discarded. It is strongly recommended to set EFileWriteDirectIO bit when opening the file. It is because that when the file write caching in file server is on, the order of file writing is not guaranteed which could cause data inconsistency in some circumstances, for example, when the power is lost in the middle of data transaction. Therefore, the file file write caching should be switched off to maintain the file integrity.
Note that ownership of the file passes to the store. The referenced RFile is cleared and is no longer valid.
Parameter | Description |
---|---|
aFile | A reference to the opened file. |
Returns: A pointer to the new permanent file store object.
CPermanentFileStore * | OpenL | ( | RFs & | aFs, |
const TDesC & | aName, | |||
TUint | aFileMode | |||
) | [static, inline] |
Reimplemented from CFileStore::OpenL(RFs &,const TDesC &,TUint)
Opens a file containing a permanent file store, and constructs a permanent file store object.
See also: TFileMode
Parameter | Description |
---|---|
aFs | Handle to a file server session. |
aName | The full path name of the file containing the store. |
aFileMode | The mode in which the file is to be accessed. The mode is defined by the TFileMode type. |
Returns: A pointer to the new permanent file store object.
CPermanentFileStore * | OpenLC | ( | RFs & | aFs, |
const TDesC & | aName, | |||
TUint | aFileMode | |||
) | [static, inline] |
Reimplemented from CFileStore::OpenLC(RFs &,const TDesC &,TUint)
Opens a file containing a permanent file store, constructs a permanent file store object, and places the pointer onto the cleanup stack.
See also: TFileMode
Parameter | Description |
---|---|
aFs | Handle to a file server session. |
aName | The full path name of the file containing the store. |
aFileMode | The mode in which the file is to be accessed. The mode is defined by the TFileMode type. |
Returns: A pointer to the new permanent file store object.
CPermanentFileStore * | ReplaceL | ( | RFs & | aFs, |
const TDesC & | aName, | |||
TUint | aFileMode | |||
) | [static, inline] |
Creates a file, constructs a permanent file store object to be associated with it.
This file replaces any existing file of the same name.
See also: TFileMode
Parameter | Description |
---|---|
aFs | Handle to a file server session. |
aName | The full path name of the file to be replaced. |
aFileMode | The mode in which the file is to be accessed. The mode is defined by the TFileMode type. |
Returns: A pointer to the new permanent file store object.
CPermanentFileStore * | ReplaceLC | ( | RFs & | aFs, |
const TDesC & | aName, | |||
TUint | aFileMode | |||
) | [static, inline] |
Creates a file, constructs a permanent file store object to be associated with it, and places the pointer onto the cleanup stack.
This file replaces any existing file of the same name.
See also: TFileMode
Parameter | Description |
---|---|
aFs | Handle to a file server session. |
aName | The full path name of the file to be replaced. |
aFileMode | The mode in which the file is to be accessed. The mode is defined by the TFileMode type. |
Returns: A pointer to the new permanent file store object.
CPermanentFileStore * | TempL | ( | RFs & | aFs, |
const TDesC & | aPath, | |||
TFileName & | aName, | |||
TUint | aFileMode | |||
) | [static, inline] |
Creates a temporary file and constructs a permanent file store object to be associated with it.
The new file is created in the specified path and a unique file name is generated by the file server.
Note that the store framework does not delete a temporary file after it is closed.
See also: TFileMode
Parameter | Description |
---|---|
aFs | Handle to a file server session. |
aPath | The path where the new file is to be created. |
aName | On return, contains the full path name of the new file. |
aFileMode | The mode in which the file is to be accessed. The mode is defined by the TFileMode type. |
Returns: A pointer to the new permanent file store object.
CPermanentFileStore * | TempLC | ( | RFs & | aFs, |
const TDesC & | aPath, | |||
TFileName & | aName, | |||
TUint | aFileMode | |||
) | [static, inline] |
Creates a temporary file, constructs a permanent file store object to be associated with it, and places the pointer onto the cleanup stack.
The new file is created in the specified path and a unique file name is generated by the file server.
Note that the store framework does not delete a temporary file after it is closed.
See also: TFileMode
Parameter | Description |
---|---|
aFs | Handle to a file server session. |
aPath | The path where the new file is to be created. |
aName | On return, contains the full path name of the new file. |
aFileMode | The mode in which the file is to be accessed. The mode is defined by the TFileMode type. |
Returns: A pointer to the new permanent file store object.