CMsvCachedStore Class Reference

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.

Inherits from

Constructor & Destructor Documentation

CMsvCachedStore(TMsvId, MMsvStoreManager &)

CMsvCachedStore(TMsvIdaId,
MMsvStoreManager &aStoreManager
)[private]

Parameters

TMsvId aId
MMsvStoreManager & aStoreManager

~CMsvCachedStore()

~CMsvCachedStore()

Member Functions Documentation

CleanArray()

voidCleanArray()[private]

Commit()

TInt Commit()

The CMsvCachedStore::Commit method

Saves the current state of the stream array to the file

CommitL()

voidCommitL()

The CMsvCachedStore::CommitL method

Saves the current state of the stream array to the file leaves with if error occurs

leave

ConstructL(TBool)

voidConstructL(TBoolaReadOnly)[private]

Parameters

TBool aReadOnly

CreateOrReplaceStreamL(TUid, CBufBase &)

voidCreateOrReplaceStreamL(TUidaUid,
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

Parameters

TUid aUidstream id
CBufBase & aBuf

DeleteL()

voidDeleteL()

DeleteStream(TUid)

TInt DeleteStream(TUidaUid)[private]

The CMsvCachedStore::DeleteStream method

deletes the stream with this id

Parameters

TUid aUidthe stream id to delete

FindStream(TUid, TInt &)

TInt FindStream(TUidaUid,
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

Parameters

TUid aUid
TInt & pos

FlattenLC(CBufBase &)

HBufC8 *FlattenLC(CBufBase &aBuf)[private, static]

Parameters

CBufBase & aBuf

GetStreamL(TUid)

HBufC8 *GetStreamL(TUidaUid)const [private]

The CMsvCachedStore::GetStream method

If it returns with KErrNone it sets aData to point to the data in the store this id

Parameters

TUid aUidstream id

IsNullL()

TBool IsNullL()const

IsPresentL(TUid)

TBool IsPresentL(TUidaUid)const

The CMsvCachedStore::IsPresentL method

checks to see if the stream is in the array

Parameters

TUid aUidstream to check for

LoadL(RFile &)

voidLoadL(RFile &aFile)[private]

The CMsvCachedStore::LoadL method

loads the streams from a file

should this create the file if it is corupt???

leave
leaves if we can't find the file, if we run out of memory, if the file is corrupt

Parameters

RFile & aFile

OpenL(TMsvId, MMsvStoreManager &, TBool)

CMsvCachedStore *OpenL(TMsvIdaId,
MMsvStoreManager &aStoreManager,
TBoolaReadOnly
)[static]

Parameters

TMsvId aId
MMsvStoreManager & aStoreManager
TBool aReadOnly

Remove(TUid)

voidRemove(TUidaUid)

The CMsvCachedStore::Remove method

Removes the stream from the array, ignores the fact that it might not exist.

Parameters

TUid aUidStream to remove

RemoveL(TUid)

voidRemoveL(TUidaUid)

The CMsvCachedStore::RemoveL method

Removes a stream from the array, leaves if the stream is not found

leave

Parameters

TUid aUidStream to remove

Revert()

voidRevert()

The CMsvCachedStore::Revert method

Reloads the array of streams from the store ignores errors that might occur.

RevertL()

voidRevertL()

The CMsvCachedStore::RevertL method

Reloads the streams from the file

leave

SaveL()

voidSaveL()[private]

The CMsvCachedStore::SaveL method

Saves the current state to iFileName

leave
leaves if we can't replace the file, if we run out of disk space,

Size()

TInt Size()const

WriteToFileStreamL(RFileWriteStream &)

voidWriteToFileStreamL(RFileWriteStream &aOut)[private]

Parameters

RFileWriteStream & aOut

Member Data Documentation

const TMsvId iEntryId

const TMsvIdiEntryId[private]

TInt iReaderCount

TInt iReaderCount[private]

TInt iSize

TInt iSize[private]

MMsvStoreManager & iStoreManager

MMsvStoreManager &iStoreManager[private]

CArrayFix< TPairedTUidHBufC8 > * iStreams

CArrayFix< TPairedTUidHBufC8 > *iStreams[private]

TInt iWriterCount

TInt iWriterCount[private]