class CMsvCachedStore : public CBase |
The CMsvCachedStore class
Implementes a set of uid/HBufC8 pairs, and persists them to a file Replaces a Dictionary Store in the message server. The difference being that this class keeps all the pairs in memory.
Public Member Functions | |
---|---|
~CMsvCachedStore() | |
TInt | Commit() |
void | CommitL() |
void | DeleteL() |
TBool | IsNullL() |
TBool | IsPresentL(TUid) |
CMsvCachedStore * | OpenL(TMsvId, MMsvStoreManager &, TBool) |
void | Remove(TUid) |
void | RemoveL(TUid) |
void | Revert() |
void | RevertL() |
TInt | Size() |
Private Member Functions | |
---|---|
CMsvCachedStore(TMsvId, MMsvStoreManager &) | |
void | CleanArray() |
void | ConstructL(TBool) |
void | CreateOrReplaceStreamL(TUid, CBufBase &) |
TInt | DeleteStream(TUid) |
TInt | FindStream(TUid, TInt &) |
HBufC8 * | FlattenLC(CBufBase &) |
HBufC8 * | GetStreamL(TUid) |
void | LoadL(RFile &) |
void | SaveL() |
void | WriteToFileStreamL(RFileWriteStream &) |
Private Attributes | |
---|---|
const TMsvId | iEntryId |
TInt | iReaderCount |
TInt | iSize |
MMsvStoreManager & | iStoreManager |
CArrayFix< TPairedTUidHBufC8 > * | iStreams |
TInt | iWriterCount |
CMsvCachedStore | ( | TMsvId | aId, |
MMsvStoreManager & | aStoreManager | ||
) | [private] |
TMsvId aId | |
MMsvStoreManager & aStoreManager |
TInt | Commit | ( | ) |
The CMsvCachedStore::Commit method
Saves the current state of the stream array to the file
void | CommitL | ( | ) |
The CMsvCachedStore::CommitL method
Saves the current state of the stream array to the file leaves with if error occurs
void | CreateOrReplaceStreamL | ( | TUid | aUid, |
CBufBase & | aBuf | |||
) | [private] |
The CMsvCachedStore::CreateOrReplaceStreamL method
If a stream is present with this id it replaces the data in that stream with aBuf, otherwise it adds a new stream with the data in aBuf
TInt | DeleteStream | ( | TUid | aUid | ) | [private] |
The CMsvCachedStore::DeleteStream method
deletes the stream with this id
TUid aUid | the stream id to delete |
TInt | FindStream | ( | TUid | aUid, |
TInt & | pos | |||
) | const [private] |
The CMsvCachedStore::FindStream method
Finds the stream of id aUid, if it returns with KErrNone then pos is set to the position of the if it is not found pos is set to where is should be inserted
HBufC8 * | GetStreamL | ( | TUid | aUid | ) | const [private] |
The CMsvCachedStore::GetStream method
If it returns with KErrNone it sets aData to point to the data in the store this id
TUid aUid | stream id |
TBool | IsPresentL | ( | TUid | aUid | ) | const |
The CMsvCachedStore::IsPresentL method
checks to see if the stream is in the array
TUid aUid | stream to check for |
void | LoadL | ( | RFile & | aFile | ) | [private] |
The CMsvCachedStore::LoadL method
loads the streams from a file
should this create the file if it is corupt???
RFile & aFile |
CMsvCachedStore * | OpenL | ( | TMsvId | aId, |
MMsvStoreManager & | aStoreManager, | |||
TBool | aReadOnly | |||
) | [static] |
TMsvId aId | |
MMsvStoreManager & aStoreManager | |
TBool aReadOnly |
void | Remove | ( | TUid | aUid | ) |
The CMsvCachedStore::Remove method
Removes the stream from the array, ignores the fact that it might not exist.
TUid aUid | Stream to remove |
void | RemoveL | ( | TUid | aUid | ) |
The CMsvCachedStore::RemoveL method
Removes a stream from the array, leaves if the stream is not found
TUid aUid | Stream to remove |
void | Revert | ( | ) |
The CMsvCachedStore::Revert method
Reloads the array of streams from the store ignores errors that might occur.
void | SaveL | ( | ) | [private] |
The CMsvCachedStore::SaveL method
Saves the current state to iFileName
void | WriteToFileStreamL | ( | RFileWriteStream & | aOut | ) | [private] |
RFileWriteStream & aOut |
Copyright ©2010 Nokia Corporation and/or its subsidiary(-ies).
All rights
reserved. Unless otherwise stated, these materials are provided under the terms of the Eclipse Public License
v1.0.