#include <S32FILE.H>
Link against:
estor.lib
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
CBase
-
Base class for all classes to be instantiated on the heap.
CFileStore
-
File based persistent store abstract base class.
CDirectFileStore
-
Direct file store.
Members
Defined in CDirectFileStore
:
CDirectFileStore(RFile &)
CDirectFileStore(RFileBuf &,const TUidType &)
CreateL(RFs &,const TDesC &,TUint)
Creates a new file and constructs a new direct file store object to be associate...
CreateLC(RFs &,const TDesC &,TUint)
Creates a new file and constructs a new direct file store object to be associate...
DoCreateL(TStreamId &)
Creates a new stream in the store. The function gets the allocated stream id in ...
DoReadL(TStreamId)const
Opens the requested stream for reading. The function should return a stream buff...
DoSetRootL(TStreamId)
Implements the setting of theroot stream.
ExternalizeL(RWriteStream &)const
FromL(RFile &)
Constructs a direct file store object from an already opened file.
FromLC(RFile &)
Constructs a direct file store object from an already opened file, and places th...
InternalizeL(RReadStream &)
Layout()const
Gets the UID that uniquely identifies this file store as a direct file store.
NewL(RFile &)
Constructs a new direct file store object in an already opened file.
NewLC(RFile &)
Constructs a new direct file store object in an already opened file and places t...
OpenL(RFs &,const TDesC &,TUint)
Opens a file containing a direct file store, and constructs a direct file store ...
OpenLC(RFs &,const TDesC &,TUint)
Opens a file containing a direct file store, constructs a direct file store obje...
ReplaceL(RFs &,const TDesC &,TUint)
Creates a file and constructs a direct file store object to be associated with i...
ReplaceLC(RFs &,const TDesC &,TUint)
Creates a file, constructs a direct file store object to be associated with it, ...
TempL(RFs &,const TDesC &,TFileName &,TUint)
Creates a temporary file and constructs a direct file store object to be associa...
TempLC(RFs &,const TDesC &,TFileName &,TUint)
Creates a temporary file, constructs a direct file store object to be associated...
Inherited from CBase
:
Inherited from CFileStore
:
CFileStore(RFile &)
CFileStore(RFileBuf &,const TUidType &)
ChangedL()
CreateL(RFs &,const TDesC &,TUint,TNewFunction)
CreateLC(RFs &,const TDesC &,TUint,TNewFunction)
Destruct()
Detach()
Detaches the file store from its associated file.
DoCommitL()
Commits any changes to the store. For a store that provides atomic updates, this...
DoRevertL()
Discards any pending changes to the store. This includes all changes which have ...
File()const
Gets a reference to the file associated with this file store.
FromL(RFile &,TFileStoreFactoryFunction)
FromL(RFile &,const TFileStoreFactoryFunction)
FromLC(RFile &,TFileStoreFactoryFunction)
FromLC(RFile &,const TFileStoreFactoryFunction)
Host()const
IsHost(const MStreamBuf *)const
MarshalL()
NewL(RFile &,TNewFunction)
NewLC(RFile &,TNewFunction)
OpenL(RFs &,const TDesC &,TUint,TFileStoreFactoryFunction)
OpenL(RFs &,const TDesC &,TUint,const TFileStoreFactoryFunction)
OpenLC(RFs &,const TDesC &,TUint,TFileStoreFactoryFunction)
OpenLC(RFs &,const TDesC &,TUint,const TFileStoreFactoryFunction)
Reattach(RFile &)
Reattaches a file to the file store. The file should be the one that was detache...
RefreshL()
ReplaceL(RFs &,const TDesC &,TUint,TNewFunction)
ReplaceLC(RFs &,const TDesC &,TUint,TNewFunction)
Reset()
Frees the file store’s buffer space.
Reset(TInt)
Frees the file store’s buffer space and changes the size of future buffer s...
SetSizeL(TInt)
SetTypeL(const TUidType &)
Sets the UID type of the file store.
SynchL()
TNewFunction
TempL(RFs &,const TDesC &,TFileName &,TUint,TNewFunction)
TempLC(RFs &,const TDesC &,TFileName &,TUint,TNewFunction)
Type()const
Gets the UID type of the file store.
Inherited from CPersistentStore
:
Inherited from CStreamStore
:
Commit()
Commits changes.
CommitL()
Commit changes and leaves if unsuccessful.
CompactL()
Compacts the store. This returns free space to the appropriate system pool, for ...
Delete(TStreamId)
Deletes the specified stream from this store.
DeleteL(TStreamId)
Deletes the specified stream from this store, leaving if unsuccessful.
ExtendL()
Generates a new stream within this store, and returns its id. This function can ...
ReclaimL()
Reclaims space within a store, returning the total amount of free space availabl...
Revert()
Rolls back the store to its state at the last commit point.
RevertL()
Rolls back the store to its state at the last commit point and leaves if unsucce...
Construction and destruction
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
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(RFile &)
IMPORT_C CDirectFileStore(RFile &aFile);
Description
Parameters
CDirectFileStore(RFileBuf &,const TUidType &)
IMPORT_C CDirectFileStore(RFileBuf &aBuf, const TUidType &aType);
Description
Parameters
OpenL(RFs &,const TDesC &,TUint)
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 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
OpenLC(RFs &,const TDesC &,TUint)
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 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
CreateL(RFs &,const TDesC &,TUint)
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 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 file is to be accessed. The mode is defined by the TFileMode type.
|
|
Return value
CreateLC(RFs &,const TDesC &,TUint)
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 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 file is to be accessed. The mode is defined by the TFileMode type.
|
|
Return value
ReplaceL(RFs &,const TDesC &,TUint)
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 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
ReplaceLC(RFs &,const TDesC &,TUint)
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 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
TempL(RFs &,const TDesC &,TFileName &,TUint)
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 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 new file is to be accessed. The mode is defined by the TFileMode type.
|
|
Return value
TempLC(RFs &,const TDesC &,TFileName &,TUint)
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 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 new file is to be accessed. The mode is defined by the TFileMode type.
|
|
Return value
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
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
IMPORT_C virtual TUid Layout() const;
Description
Gets the UID that uniquely identifies this file store as a direct file store.
Return value
TUid
|
KDirectFileStoreLayoutUid.
|
|
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 CDirectFileStore::OpenL(RFs &,const TDesC &,TUint)
and CDirectFileStore::OpenLC(RFs &,const TDesC &,TUint)
member functions of RStoreReadStream
.
Parameters
Return value
MStreamBuf *
|
A stream buffer positioned at the beginning of the stream to be read.
|
|
See also:
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
ExternalizeL(RWriteStream &)const
private: IMPORT_C virtual void ExternalizeL(RWriteStream &aStream) const;
Description
Parameters
InternalizeL(RReadStream &)
private: IMPORT_C virtual void InternalizeL(RReadStream &aStream);
Description
Parameters
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: