|
||
class CPermanentFileStore : public CFileStore;
Permanent file store.
This type of store supports full manipulation of store contents. Existing streams within this type of store can be changed.
CBase
-
Base class for all classes to be instantiated on the heap.
CStreamStore
- ...
CPersistentStore
- ...
CFileStore
-
File based persistent store abstract base class.
CPermanentFileStore
-
Permanent file store.
Defined in CPermanentFileStore
:
CPermanentFileStore(RFile &)
CPermanentFileStore(RFileBuf &,const TUidType &)
CreateL(RFs &,const TDesC &,TUint)
Creates a new file and constructs a new permanent file store object to be associ...CreateLC(RFs &,const TDesC &,TUint)
Creates a new file and constructs a new permanent file store object to be associ...DoCommitL()
Commits any changes to the store. For a store that provides atomic updates, this...DoCompactL()
Initialises an object for compacting space in the store. This function provides ...DoCreateL(TStreamId &)
Creates a new stream in the store. The function gets the allocated stream id in ...DoDeleteL(TStreamId)
DoExtendL()
Generates a new stream within this store, and returns its id. This function is i...DoReadL(TStreamId)const
Opens the requested stream for reading. The function should return a stream buff...DoReclaimL()
Initialises an object for reclaiming space in the store. This function provides ...DoReplaceL(TStreamId)
DoRevertL()
Discards any pending changes to the store. This includes all changes which have ...DoSetRootL(TStreamId)
Implements the setting of theroot stream.DoWriteL(TStreamId)
ExternalizeL(RWriteStream &)const
FromL(RFile &)
Constructs a permanent file store object from an already opened file.FromLC(RFile &)
Constructs a permanent file store object from an already opened file, and places...InternalizeL(RReadStream &)
Layout()const
Gets the UID that uniquely identifies this file store as a permanent file store.MarshalL()
NewL(RFile &)
Constructs a new permanent file store object in an already opened file.NewLC(RFile &)
Constructs a new permanent file store object in an already opened file and place...OpenL(RFs &,const TDesC &,TUint)
Opens a file containing a permanent file store, and constructs a permanent file ...OpenLC(RFs &,const TDesC &,TUint)
Opens a file containing a permanent file store, constructs a permanent file stor...ReplaceL(RFs &,const TDesC &,TUint)
Creates a file, constructs a permanent file store object to be associated with i...ReplaceLC(RFs &,const TDesC &,TUint)
Creates a file, constructs a permanent file store object to be associated with i...TempL(RFs &,const TDesC &,TFileName &,TUint)
Creates a temporary file and constructs a permanent file store object to be asso...TempLC(RFs &,const TDesC &,TFileName &,TUint)
Creates a temporary file, constructs a permanent file store object to be associa...~CPermanentFileStore()
Frees resources owned by the object, prior to its destruction. Inherited from CBase
:
Delete(CBase *)
Deletes the specified object.Extension_(TUint,TAny *&,TAny *)
Extension function operator new(TUint)
Allocates the object from the heap and then initialises its contents to binary z...operator new(TUint,TAny *)
Initialises the object to binary zeroes.operator new(TUint,TLeave)
Allocates the object from the heap and then initialises its contents to binary z...operator new(TUint,TLeave,TUint)
Allocates the object from the heap and then initialises its contents to binary z...operator new(TUint,TUint)
Allocates the object from the heap and then initialises its contents to binary z...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.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
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
:
Root()const
Returns the stream id of the root stream.SetRootL(TStreamId)
Sets the specified stream as the root stream.iRoot
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...static inline CPermanentFileStore* NewL(RFile &aFile);
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.
|
|
static inline CPermanentFileStore* NewLC(RFile &aFile);
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.
|
|
IMPORT_C CPermanentFileStore(RFileBuf &aBuf, const TUidType &aType);
|
IMPORT_C ~CPermanentFileStore();
Frees resources owned by the object, prior to its destruction.
static inline CPermanentFileStore* OpenL(RFs &aFs, const TDesC &aName, TUint aFileMode);
Opens a file containing a permanent file store, and constructs a permanent file store object.
|
|
static inline CPermanentFileStore* OpenLC(RFs &aFs, const TDesC &aName, TUint aFileMode);
Opens a file containing a permanent file store, constructs a permanent file store object, and places the pointer onto the cleanup stack.
|
|
static inline CPermanentFileStore* CreateL(RFs &aFs, const TDesC &aName, TUint aFileMode);
Creates a new file and constructs a new permanent file store object to be associated with this file.
|
|
static inline CPermanentFileStore* CreateLC(RFs &aFs, const TDesC &aName, TUint aFileMode);
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.
|
|
static inline CPermanentFileStore* ReplaceL(RFs &aFs, const TDesC &aName, TUint aFileMode);
Creates a file, constructs a permanent file store object to be associated with it.
This file replaces any existing file of the same name.
|
|
static inline CPermanentFileStore* ReplaceLC(RFs &aFs, const TDesC &aName, TUint aFileMode);
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.
|
|
static inline CPermanentFileStore* TempL(RFs &aFs, const TDesC &aPath, TFileName &aName, TUint aFileMode);
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.
|
|
static inline CPermanentFileStore* TempLC(RFs &aFs, const TDesC &aPath, TFileName &aName, TUint aFileMode);
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.
|
|
static inline CPermanentFileStore* FromL(RFile &aFile);
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.
|
|
static inline CPermanentFileStore* FromLC(RFile &aFile);
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.
|
|
IMPORT_C virtual TUid Layout() const;
Gets the UID that uniquely identifies this file store as a permanent file store.
|
protected: IMPORT_C virtual MStreamBuf* DoReadL(TStreamId anId) 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 CPermanentFileStore::OpenL(RFs &,const TDesC &,TUint)
and CPermanentFileStore::OpenLC(RFs &,const TDesC &,TUint)
member functions of RStoreReadStream
.
|
|
RStoreReadStream::OpenL(const CStreamStore &,TStreamId)
Opens and prepares an existing stream for reading. The function leaves if it can...RStoreReadStream::OpenLC(const CStreamStore &,TStreamId)
Opens and prepares an existing stream for reading, leaving a cleanup item on the...protected: IMPORT_C virtual MStreamBuf* DoCreateL(TStreamId &anId);
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.
|
|
protected: IMPORT_C virtual MStreamBuf* DoWriteL(TStreamId anId);
|
|
protected: IMPORT_C virtual MStreamBuf* DoReplaceL(TStreamId anId);
|
|
private: IMPORT_C virtual void ExternalizeL(RWriteStream &aStream) const;
|
private: IMPORT_C virtual void InternalizeL(RReadStream &aStream);
|
private: IMPORT_C virtual void DoSetRootL(TStreamId anId);
Implements the setting of theroot stream.
This function is called by CPersistentStore::SetRootL(TStreamId)
|
CPersistentStore::SetRootL(TStreamId)
Sets the specified stream as the root stream.private: IMPORT_C virtual TStreamId DoExtendL();
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()
.
|
CStreamStore::ExtendL()
Generates a new stream within this store, and returns its id. This function can ...private: IMPORT_C virtual void DoCommitL();
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.
private: IMPORT_C virtual void DoRevertL();
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.
private: IMPORT_C virtual MIncrementalCollector* DoReclaimL();
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.
|
private: IMPORT_C virtual MIncrementalCollector* DoCompactL();
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.
|