Symbian
Symbian OS Library

SYMBIAN OS V9.3

[Index] [Spacer] [Previous] [Next]



Location: S32FILE.H
Link against: estor.lib

Class CDirectFileStore

class CDirectFileStore : public CFileStore;

Description

Direct file store.

A direct file store implements a subset of the operations defined by the store abstract framework. Direct file stores allow streams to be created and objects externalised to them however once the streams have been committed and closed, they cannot subsequently be changed, i.e. streams cannot be replaced, deleted, extended or changed in any way.

Derivation

Members

Defined in CDirectFileStore:
CDirectFileStore(), CDirectFileStore(), CreateL(), CreateLC(), DoCreateL(), DoReadL(), DoSetRootL(), ExternalizeL(), FromL(), FromLC(), InternalizeL(), Layout(), NewL(), NewLC(), OpenL(), OpenLC(), ReplaceL(), ReplaceLC(), TempL(), TempLC()

Inherited from CBase:
Extension_(), operator new()

Inherited from CFileStore:
ChangedL(), Destruct(), Detach(), DoCommitL(), DoRevertL(), File(), Host(), IsHost(), MarshalL(), Reattach(), RefreshL(), Reset(), SetSizeL(), SetTypeL(), SynchL(), TNewFunction, Type()

Inherited from CPersistentStore:
Root(), SetRootL(), iRoot

Inherited from CStreamStore:
Commit(), CommitL(), CompactL(), Delete(), DeleteL(), DoCompactL(), DoDeleteL(), DoExtendL(), DoReclaimL(), DoReplaceL(), DoWriteL(), ExtendL(), ReclaimL(), Revert(), RevertL()


Construction and destruction


NewL()

static inline CDirectFileStore *NewL(RFile &aFile);

Description

Constructs a new direct file store object in an already opened file.

The file must already be open before calling the 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

CDirectFileStore *

A pointer to the new direct file store object.


NewLC()

static inline CDirectFileStore *NewLC(RFile &aFile);

Description

Constructs a new direct file store object in an already opened file and places the pointer onto the cleanup stack.

The file must already be open before calling the 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

CDirectFileStore *

A pointer to the new direct file store object.


CDirectFileStore()

IMPORT_C CDirectFileStore(RFile &aFile);

Description

Parameters

RFile &aFile


CDirectFileStore()

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

Description

Parameters

RFileBuf &aBuf

const TUidType &aType

[Top]


Member functions


OpenL()

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

Description

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

Parameters

RFs &aFs

Handle to a file server session.

const TDesC &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

CDirectFileStore *

A pointer to the new direct file store object.

See also:


OpenLC()

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

Description

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

Parameters

RFs &aFs

Handle to a file server session.

const TDesC &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

CDirectFileStore *

A pointer to the new direct file store object.

See also:


CreateL()

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

Description

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

Parameters

RFs &aFs

Handle to a file server session.

const TDesC &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 file is to be accessed. The mode is defined by the TFileMode type.

Return value

CDirectFileStore *

A pointer to the new direct file store object

See also:


CreateLC()

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

Description

Creates a new file and constructs a new direct 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 TDesC &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 file is to be accessed. The mode is defined by the TFileMode type.

Return value

CDirectFileStore *

A pointer to the new direct file store object

See also:


ReplaceL()

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

Description

Creates a file and constructs a direct file store object to be associated with it.

The file replaces any existing file of the same name.

Parameters

RFs &aFs

Handle to a file server session.

const TDesC &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

CDirectFileStore *

A pointer to the new direct file store object.

See also:


ReplaceLC()

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

Description

Creates a file, constructs a direct file store object to be associated with it, and places the pointer onto the cleanup stack.

The file replaces any existing file of the same name.

Parameters

RFs &aFs

Handle to a file server session.

const TDesC &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

CDirectFileStore *

A pointer to the new direct file store object.

See also:


TempL()

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

Description

Creates a temporary file and constructs a direct 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 TDesC &aPath

The path where the new file is to be created.

TFileName &aName

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

TUint aFileMode

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

Return value

CDirectFileStore *

A pointer to the new direct file store object.

See also:


TempLC()

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

Description

Creates a temporary file, constructs a direct 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 TDesC &aPath

The path where the new file is to be created.

TFileName &aName

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

TUint aFileMode

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

Return value

CDirectFileStore *

A pointer to the new direct file store object.

See also:


FromL()

static inline CDirectFileStore *FromL(RFile &aFile);

Description

Constructs a direct 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

CDirectFileStore *

A pointer to the new direct file store object.


FromLC()

static inline CDirectFileStore *FromLC(RFile &aFile);

Description

Constructs a direct 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

CDirectFileStore *

A pointer to the new direct file store object.


Layout()

virtual IMPORT_C TUid Layout() const;

Description

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

Return value

TUid

KDirectFileStoreLayoutUid.


DoReadL()

protected: virtual IMPORT_C 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 OpenL() and OpenLC() 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()

protected: virtual IMPORT_C 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() functions.

Parameters

TStreamId &anId

On return, contains the allocated stream id.

Return value

MStreamBuf *

The stream buffer to be written to.


ExternalizeL()

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

Description

Parameters

RWriteStream &aStream


InternalizeL()

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

Description

Parameters

RReadStream &aStream


DoSetRootL()

private: virtual IMPORT_C void DoSetRootL(TStreamId anId);

Description

Implements the setting of theroot stream.

This function is called by SetRootL()

Parameters

TStreamId anId

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

See also: