CDirectFileStore Class Reference

#include <s32file.h>

class CDirectFileStore : public CFileStore

Inherits from

Public Member Functions
CDirectFileStore(RFile &)
CDirectFileStore(RFileBuf &, const TUidType &)
CDirectFileStore *CreateL(RFs &, const TDesC &, TUint)
CDirectFileStore *CreateLC(RFs &, const TDesC &, TUint)
CDirectFileStore *FromL(RFile &)
CDirectFileStore *FromLC(RFile &)
virtual IMPORT_C TUidLayout()
CDirectFileStore *NewL(RFile &)
CDirectFileStore *NewLC(RFile &)
CDirectFileStore *OpenL(RFs &, const TDesC &, TUint)
CDirectFileStore *OpenLC(RFs &, const TDesC &, TUint)
CDirectFileStore *ReplaceL(RFs &, const TDesC &, TUint)
CDirectFileStore *ReplaceLC(RFs &, const TDesC &, TUint)
CDirectFileStore *TempL(RFs &, const TDesC &, TFileName &, TUint)
CDirectFileStore *TempLC(RFs &, const TDesC &, TFileName &, TUint)
Protected Member Functions
virtual IMPORT_C MStreamBuf *DoCreateL(TStreamId &)
virtual IMPORT_C MStreamBuf *DoReadL(TStreamId)
Inherited Attributes
CPersistentStore::iRoot
Inherited Functions
CBase::CBase()
CBase::Delete(CBase *)
CBase::Extension_(TUint,TAny *&,TAny *)
CBase::operator new(TUint)
CBase::operator new(TUint,TAny *)
CBase::operator new(TUint,TLeave)
CBase::operator new(TUint,TLeave,TUint)
CBase::operator new(TUint,TUint)
CBase::~CBase()
CFileStore::CFileStore(RFile &)
CFileStore::CFileStore(RFileBuf &,const TUidType &)
CFileStore::ChangedL()
CFileStore::CreateL(RFs &,const TDesC &,TUint,TNewFunction)
CFileStore::CreateLC(RFs &,const TDesC &,TUint,TNewFunction)
CFileStore::Destruct()
CFileStore::Detach()
CFileStore::DoCommitL()
CFileStore::DoRevertL()
CFileStore::File()const
CFileStore::FromL(RFile &,TFileStoreFactoryFunction)
CFileStore::FromL(RFile &,const TFileStoreFactoryFunction)
CFileStore::FromLC(RFile &,TFileStoreFactoryFunction)
CFileStore::FromLC(RFile &,const TFileStoreFactoryFunction)
CFileStore::Host()const
CFileStore::IsHost(const MStreamBuf *)const
CFileStore::MarshalL()
CFileStore::NewL(RFile &,TNewFunction)
CFileStore::NewLC(RFile &,TNewFunction)
CFileStore::OpenL(RFs &,const TDesC &,TUint,TFileStoreFactoryFunction)
CFileStore::OpenL(RFs &,const TDesC &,TUint,const TFileStoreFactoryFunction)
CFileStore::OpenLC(RFs &,const TDesC &,TUint,TFileStoreFactoryFunction)
CFileStore::OpenLC(RFs &,const TDesC &,TUint,const TFileStoreFactoryFunction)
CFileStore::Reattach(RFile &)
CFileStore::RefreshL()
CFileStore::ReplaceL(RFs &,const TDesC &,TUint,TNewFunction)
CFileStore::ReplaceLC(RFs &,const TDesC &,TUint,TNewFunction)
CFileStore::Reset()
CFileStore::Reset(TInt)
CFileStore::SetSizeL(TInt)
CFileStore::SetTypeL(const TUidType &)
CFileStore::SynchL()
CFileStore::TempL(RFs &,const TDesC &,TFileName &,TUint,TNewFunction)
CFileStore::TempLC(RFs &,const TDesC &,TFileName &,TUint,TNewFunction)
CFileStore::Type()const
CFileStore::~CFileStore()
CPersistentStore::CPersistentStore()
CPersistentStore::Root()const
CPersistentStore::SetRootL(TStreamId)
CStreamStore::Commit()
CStreamStore::CommitL()
CStreamStore::CompactL()
CStreamStore::Delete(TStreamId)
CStreamStore::DeleteL(TStreamId)
CStreamStore::ExtendL()
CStreamStore::ReclaimL()
CStreamStore::Revert()
CStreamStore::RevertL()
Inherited Type Definitions
CFileStore::TNewFunction

Detailed 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.

Constructor & Destructor Documentation

CDirectFileStore ( RFile & )

IMPORT_CCDirectFileStore(RFile &aFile)

CDirectFileStore ( RFileBuf &, const TUidType & )

IMPORT_CCDirectFileStore(RFileBuf &aBuf,
const TUidType &aType
)

Member Function Documentation

CreateL ( RFs &, const TDesC &, TUint )

CDirectFileStore *CreateL(RFs &aFs,
const TDesC &aName,
TUintaFileMode
)[static, inline]

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

See also: TFileMode

ParameterDescription
aFsHandle to a file server session.
aNameThe full path name of the new file. A file with this name must not already exist, otherwise the function leaves.
aFileModeThe mode in which the file is to be accessed. The mode is defined by the TFileMode type.

Returns: A pointer to the new direct file store object

CreateLC ( RFs &, const TDesC &, TUint )

CDirectFileStore *CreateLC(RFs &aFs,
const TDesC &aName,
TUintaFileMode
)[static, inline]

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.

See also: TFileMode

ParameterDescription
aFsHandle to a file server session.
aNameThe full path name of the new file. A file with this name must not already exist, otherwise the function leaves.
aFileModeThe mode in which the file is to be accessed. The mode is defined by the TFileMode type.

Returns: A pointer to the new direct file store object

DoCreateL ( TStreamId & )

IMPORT_C MStreamBuf *DoCreateL(TStreamId &anId)[protected, virtual]

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.

ParameterDescription
anIdOn return, contains the allocated stream id.

Returns: The stream buffer to be written to.

DoReadL ( TStreamId )

IMPORT_C MStreamBuf *DoReadL(TStreamIdanId)const [protected, virtual]

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()

ParameterDescription
anIdThe stream to be read.

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

FromL ( RFile & )

CDirectFileStore *FromL(RFile &aFile)[static, inline]

Reimplemented from CFileStore::FromL(RFile &)

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.

ParameterDescription
aFileA reference to the opened file.

Returns: A pointer to the new direct file store object.

FromLC ( RFile & )

CDirectFileStore *FromLC(RFile &aFile)[static, inline]

Reimplemented from CFileStore::FromLC(RFile &)

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.

ParameterDescription
aFileA reference to the opened file.

Returns: A pointer to the new direct file store object.

Layout ( )

IMPORT_C TUidLayout()const [virtual]

Reimplemented from CFileStore::Layout()const

Gets the UID that uniquely identifies the specific type of this file store.

This function must be defined and implemented by classes derived from CFileStore. The direct file store, CDirectFileStore and the permanent file store, CPermanentFileStore both implement suitable functions.

See also: KDirectFileStoreLayoutUid KPermanentFileStoreLayoutUid

Returns: The UID that uniquely identifies the specific type of file store.

NewL ( RFile & )

CDirectFileStore *NewL(RFile &aFile)[static, inline]

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:

ParameterDescription
aFileA reference to the opened file.

Returns: A pointer to the new direct file store object.

NewLC ( RFile & )

CDirectFileStore *NewLC(RFile &aFile)[static, inline]

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:

ParameterDescription
aFileA reference to the opened file.

Returns: A pointer to the new direct file store object.

OpenL ( RFs &, const TDesC &, TUint )

CDirectFileStore *OpenL(RFs &aFs,
const TDesC &aName,
TUintaFileMode
)[static, inline]

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

See also: TFileMode

ParameterDescription
aFsHandle to a file server session.
aNameThe full path name of the file containing the store.
aFileModeThe mode in which the file is to be accessed. The mode is defined by the TFileMode type.

Returns: A pointer to the new direct file store object.

OpenLC ( RFs &, const TDesC &, TUint )

CDirectFileStore *OpenLC(RFs &aFs,
const TDesC &aName,
TUintaFileMode
)[static, inline]

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

See also: TFileMode

ParameterDescription
aFsHandle to a file server session.
aNameThe full path name of the file containing the store.
aFileModeThe mode in which the file is to be accessed. The mode is defined by the TFileMode type.

Returns: A pointer to the new direct file store object.

ReplaceL ( RFs &, const TDesC &, TUint )

CDirectFileStore *ReplaceL(RFs &aFs,
const TDesC &aName,
TUintaFileMode
)[static, inline]

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.

See also: TFileMode

ParameterDescription
aFsHandle to a file server session.
aNameThe full path name of the file to be replaced.
aFileModeThe mode in which the file is to be accessed. The mode is defined by the TFileMode type.

Returns: A pointer to the new direct file store object.

ReplaceLC ( RFs &, const TDesC &, TUint )

CDirectFileStore *ReplaceLC(RFs &aFs,
const TDesC &aName,
TUintaFileMode
)[static, inline]

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.

See also: TFileMode

ParameterDescription
aFsHandle to a file server session.
aNameThe full path name of the file to be replaced.
aFileModeThe mode in which the file is to be accessed. The mode is defined by the TFileMode type.

Returns: A pointer to the new direct file store object.

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

CDirectFileStore *TempL(RFs &aFs,
const TDesC &aPath,
TFileName &aName,
TUintaFileMode
)[static, inline]

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.

See also: TFileMode

ParameterDescription
aFsHandle to a file server session.
aPathThe path where the new file is to be created.
aNameOn return, contains the full path name of the new file.
aFileModeThe mode in which the new file is to be accessed. The mode is defined by the TFileMode type.

Returns: A pointer to the new direct file store object.

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

CDirectFileStore *TempLC(RFs &aFs,
const TDesC &aPath,
TFileName &aName,
TUintaFileMode
)[static, inline]

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.

See also: TFileMode

ParameterDescription
aFsHandle to a file server session.
aPathThe path where the new file is to be created.
aNameOn return, contains the full path name of the new file.
aFileModeThe mode in which the new file is to be accessed. The mode is defined by the TFileMode type.

Returns: A pointer to the new direct file store object.