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 ( TMsvId aId,
MMsvStoreManager & aStoreManager
) [private]

Parameters

TMsvId aId
MMsvStoreManager & aStoreManager

~CMsvCachedStore()

~CMsvCachedStore ( )

Member Functions Documentation

CleanArray()

void CleanArray ( ) [private]

Commit()

TInt Commit ( )

The CMsvCachedStore::Commit method

Saves the current state of the stream array to the file

CommitL()

void CommitL ( )

The CMsvCachedStore::CommitL method

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

leave

ConstructL(TBool)

void ConstructL ( TBool aReadOnly ) [private]

Parameters

TBool aReadOnly

CreateOrReplaceStreamL(TUid, CBufBase &)

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

Parameters

TUid aUid stream id
CBufBase & aBuf

DeleteL()

void DeleteL ( )

DeleteStream(TUid)

TInt DeleteStream ( TUid aUid ) [private]

The CMsvCachedStore::DeleteStream method

deletes the stream with this id

Parameters

TUid aUid the stream id to delete

FindStream(TUid, TInt &)

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

Parameters

TUid aUid
TInt & pos

FlattenLC(CBufBase &)

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

Parameters

CBufBase & aBuf

GetStreamL(TUid)

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

Parameters

TUid aUid stream id

IsNullL()

TBool IsNullL ( ) const

IsPresentL(TUid)

TBool IsPresentL ( TUid aUid ) const

The CMsvCachedStore::IsPresentL method

checks to see if the stream is in the array

Parameters

TUid aUid stream to check for

LoadL(RFile &)

void LoadL ( 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 ( TMsvId aId,
MMsvStoreManager & aStoreManager,
TBool aReadOnly
) [static]

Parameters

TMsvId aId
MMsvStoreManager & aStoreManager
TBool aReadOnly

Remove(TUid)

void Remove ( TUid aUid )

The CMsvCachedStore::Remove method

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

Parameters

TUid aUid Stream to remove

RemoveL(TUid)

void RemoveL ( TUid aUid )

The CMsvCachedStore::RemoveL method

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

leave

Parameters

TUid aUid Stream to remove

Revert()

void Revert ( )

The CMsvCachedStore::Revert method

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

RevertL()

void RevertL ( )

The CMsvCachedStore::RevertL method

Reloads the streams from the file

leave

SaveL()

void SaveL ( ) [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 &)

void WriteToFileStreamL ( RFileWriteStream & aOut ) [private]

Parameters

RFileWriteStream & aOut

Member Data Documentation

const TMsvId iEntryId

const TMsvId iEntryId [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]