Symbian
Symbian Developer Library

SYMBIAN OS V9.4

Feedback

[Index] [Previous] [Next]

#include <S32FILE.H>
Link against: estor.lib

Class CPermanentFileStore

class CPermanentFileStore : public CFileStore;

Description

Permanent file store.

This type of store supports full manipulation of store contents. Existing streams within this type of store can be changed.

Derivation

Members

Defined in CPermanentFileStore:

Inherited from CBase:

Inherited from CFileStore:

Inherited from CPersistentStore:

Inherited from CStreamStore:


Construction and destruction


NewL(RFile &)

static inline CPermanentFileStore* NewL(RFile &aFile);

Description

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.

Note that ownership of the file passes to the store. The referenced RFile is cleared and is no longer valid.

Parameters

RFile &aFile

A reference to the opened file.

Return value

CPermanentFileStore *

A pointer to the new permanent file store object.


NewLC(RFile &)

static inline CPermanentFileStore* NewLC(RFile &aFile);

Description

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.

Note that ownership of the file passes to the store. The referenced RFile is cleared and is no longer valid.

Parameters

RFile &aFile

A reference to the opened file.

Return value

CPermanentFileStore *

A pointer to the new permanent file store object.


CPermanentFileStore(RFile &)

IMPORT_C CPermanentFileStore(RFile &aFile);

Description

Parameters

RFile &aFile


CPermanentFileStore(RFileBuf &,const TUidType &)

IMPORT_C CPermanentFileStore(RFileBuf &aBuf, const TUidType &aType);

Description

Parameters

RFileBuf &aBuf

const TUidType &aType


~CPermanentFileStore()

IMPORT_C ~CPermanentFileStore();

Description

Frees resources owned by the object, prior to its destruction.

[Top]


Member functions


OpenL(RFs &,const TDesC &,TUint)

static inline CPermanentFileStore* OpenL(RFs &aFs, const TDesC &aName, TUint aFileMode);

Description

Opens a file containing a permanent file store, and constructs a permanent file store object.

Parameters

RFs &aFs

Handle to a file server session.

const TDesC16 &aName

The full path name of the file containing the store.

TUint aFileMode

The mode in which the file is to be accessed. The mode is defined by the TFileMode type.

Return value

CPermanentFileStore *

A pointer to the new permanent file store object.


OpenLC(RFs &,const TDesC &,TUint)

static inline CPermanentFileStore* OpenLC(RFs &aFs, const TDesC &aName, TUint aFileMode);

Description

Opens a file containing a permanent file store, constructs a permanent file store object, and places the pointer onto the cleanup stack.

Parameters

RFs &aFs

Handle to a file server session.

const TDesC16 &aName

The full path name of the file containing the store.

TUint aFileMode

The mode in which the file is to be accessed. The mode is defined by the TFileMode type.

Return value

CPermanentFileStore *

A pointer to the new permanent file store object.


CreateL(RFs &,const TDesC &,TUint)

static inline CPermanentFileStore* CreateL(RFs &aFs, const TDesC &aName, TUint aFileMode);

Description

Creates a new file and constructs a new permanent file store object to be associated with this file.

Parameters

RFs &aFs

Handle to a file server session.

const TDesC16 &aName

The full path name of the new file. A file with this name must not already exist, otherwise the function leaves.

TUint aFileMode

The mode in which the new file is to be accessed. This mode is defined by the TFileMode type.

Return value

CPermanentFileStore *

A pointer to the new permanent file store object.


CreateLC(RFs &,const TDesC &,TUint)

static inline CPermanentFileStore* CreateLC(RFs &aFs, const TDesC &aName, TUint aFileMode);

Description

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.

Parameters

RFs &aFs

Handle to a file server session.

const TDesC16 &aName

The full path name of the new file. A file with this name must not already exist, otherwise the function leaves.

TUint aFileMode

The mode in which the new file is to be accessed. This mode is defined by the TFileMode type.

Return value

CPermanentFileStore *

A pointer to the new permanent file store object.


ReplaceL(RFs &,const TDesC &,TUint)

static inline CPermanentFileStore* ReplaceL(RFs &aFs, const TDesC &aName, TUint aFileMode);

Description

Creates a file, constructs a permanent file store object to be associated with it.

This file replaces any existing file of the same name.

Parameters

RFs &aFs

Handle to a file server session.

const TDesC16 &aName

The full path name of the file to be replaced.

TUint aFileMode

The mode in which the file is to be accessed. The mode is defined by the TFileMode type.

Return value

CPermanentFileStore *

A pointer to the new permanent file store object.


ReplaceLC(RFs &,const TDesC &,TUint)

static inline CPermanentFileStore* ReplaceLC(RFs &aFs, const TDesC &aName, TUint aFileMode);

Description

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.

Parameters

RFs &aFs

Handle to a file server session.

const TDesC16 &aName

The full path name of the file to be replaced.

TUint aFileMode

The mode in which the file is to be accessed. The mode is defined by the TFileMode type.

Return value

CPermanentFileStore *

A pointer to the new permanent file store object.


TempL(RFs &,const TDesC &,TFileName &,TUint)

static inline CPermanentFileStore* TempL(RFs &aFs, const TDesC &aPath, TFileName &aName, TUint aFileMode);

Description

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.

Parameters

RFs &aFs

Handle to a file server session.

const TDesC16 &aPath

The path where the new file is to be created.

TBuf &aName

On return, contains the full path name of the new file.

TUint aFileMode

The mode in which the file is to be accessed. The mode is defined by the TFileMode type.

Return value

CPermanentFileStore *

A pointer to the new permanent file store object.


TempLC(RFs &,const TDesC &,TFileName &,TUint)

static inline CPermanentFileStore* TempLC(RFs &aFs, const TDesC &aPath, TFileName &aName, TUint aFileMode);

Description

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.

Parameters

RFs &aFs

Handle to a file server session.

const TDesC16 &aPath

The path where the new file is to be created.

TBuf &aName

On return, contains the full path name of the new file.

TUint aFileMode

The mode in which the file is to be accessed. The mode is defined by the TFileMode type.

Return value

CPermanentFileStore *

A pointer to the new permanent file store object.


FromL(RFile &)

static inline CPermanentFileStore* FromL(RFile &aFile);

Description

Constructs a permanent file store object from an already opened file.

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.

Parameters

RFile &aFile

A reference to the opened file.

Return value

CPermanentFileStore *

A pointer to the new permanent file store object.


FromLC(RFile &)

static inline CPermanentFileStore* FromLC(RFile &aFile);

Description

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.

Note that ownership of the file passes to the store. The referenced RFile is cleared and is no longer valid.

Parameters

RFile &aFile

A reference to the opened file.

Return value

CPermanentFileStore *

A pointer to the new permanent file store object.


Layout()const

IMPORT_C virtual TUid Layout() const;

Description

Gets the UID that uniquely identifies this file store as a permanent file store.

Return value

TUid

KPermanentFileStoreLayoutUid.


MarshalL()

IMPORT_C void MarshalL();

Description


DoReadL(TStreamId)const

protected: IMPORT_C virtual MStreamBuf* DoReadL(TStreamId anId) const;

Description

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 CPermanentFileStore::OpenL(RFs &,const TDesC &,TUint) and CPermanentFileStore::OpenLC(RFs &,const TDesC &,TUint) member functions of RStoreReadStream.

Parameters

TStreamId anId

The stream to be read.

Return value

MStreamBuf *

A stream buffer positioned at the beginning of the stream to be read.

See also:


DoCreateL(TStreamId &)

protected: IMPORT_C virtual MStreamBuf* DoCreateL(TStreamId &anId);

Description

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(CStreamStore &) functions.

Parameters

TStreamId &anId

On return, contains the allocated stream id.

Return value

MStreamBuf *

The stream buffer to be written to.


DoWriteL(TStreamId)

protected: IMPORT_C virtual MStreamBuf* DoWriteL(TStreamId anId);

Description

Parameters

TStreamId anId

Return value

MStreamBuf *


DoReplaceL(TStreamId)

protected: IMPORT_C virtual MStreamBuf* DoReplaceL(TStreamId anId);

Description

Parameters

TStreamId anId

Return value

MStreamBuf *


ExternalizeL(RWriteStream &)const

private: IMPORT_C virtual void ExternalizeL(RWriteStream &aStream) const;

Description

Parameters

RWriteStream &aStream


InternalizeL(RReadStream &)

private: IMPORT_C virtual void InternalizeL(RReadStream &aStream);

Description

Parameters

RReadStream &aStream


DoSetRootL(TStreamId)

private: IMPORT_C virtual void DoSetRootL(TStreamId anId);

Description

Implements the setting of theroot stream.

This function is called by CPersistentStore::SetRootL(TStreamId)

Parameters

TStreamId anId

The id of the stream which is to be the root stream of the store.

See also:


DoExtendL()

private: IMPORT_C virtual TStreamId DoExtendL();

Description

Generates a new stream within this store, and returns its id. This function is intended to create a new stream in advance of being written to.

This is called by CStreamStore::ExtendL().

Return value

TStreamId

The new stream id.

See also:


DoDeleteL(TStreamId)

private: IMPORT_C virtual void DoDeleteL(TStreamId anId);

Description

Parameters

TStreamId anId


DoCommitL()

private: IMPORT_C virtual void DoCommitL();

Description

Commits any changes to the store. For a store that provides atomic updates, this writes all of the pending updates to the to the permanent storage medium. After committing the store contains all or none of the updates since the last commit/revert.

This function provides the implementation for the public CStreamStore::CommitL() function.


DoRevertL()

private: IMPORT_C virtual void DoRevertL();

Description

Discards any pending changes to the store. This includes all changes which have not been committed to a permanent storage medium.

This function provides the implementation for the public CStreamStore::Revert() function.

Note:

The function need only be implemented by stores that provide atomic updates, as revert has no meaning for other implementations.


DoReclaimL()

private: IMPORT_C virtual MIncrementalCollector* DoReclaimL();

Description

Initialises an object for reclaiming space in the store. This function provides the direct implementation for RStoreReclaim::OpenL(CStreamStore &,TInt &).

Note:

Actually reclaiming the space is done by repeated calls to MIncrementalCollector::Next(), before releasing the object.

Return value

MIncrementalCollector *

Pointer to an incremental collector, which implements the interface for reclaiming store space.


DoCompactL()

private: IMPORT_C virtual MIncrementalCollector* DoCompactL();

Description

Initialises an object for compacting space in the store. This function provides the direct implementation for RStoreReclaim::CompactL(CStreamStore &,TInt &).

Note:

Actually compacting the space is done by repeated calls to MIncrementalCollector::Next() before releasing the object.

Return value

MIncrementalCollector *

Pointer to an incremental collector, which implements the interface for compacting store space.