messagingappbase/obexmtms/obexmtm/obexutil/source/obexMtmUtil.cpp
branchRCL_3
changeset 60 7fdbb852d323
parent 57 ebe688cedc25
equal deleted inserted replaced
57:ebe688cedc25 60:7fdbb852d323
    34 
    34 
    35 static const TInt KObexArrayGranularity = 4;
    35 static const TInt KObexArrayGranularity = 4;
    36 
    36 
    37 //
    37 //
    38 //
    38 //
    39 //  Class for externalising a set of filenames to the same message entry store. Rolls back if not explicitly committed.
    39 //  Class for externalising a set of filenames to the same message entry store. Rolls back if not explicitely committed.
    40 //
    40 //
    41 
    41 
    42 // Static functions that do the whole process in one go:
    42 // Static functions that do the whole process in one go:
    43 EXPORT_C  void CObexMtmFileNameExternaliser::ExternaliseAndCommit1FileNameL(CMsvEntry* aEntry, const TDesC16* aFileName)
    43 EXPORT_C  void CObexMtmFileNameExternaliser::ExternaliseAndCommit1FileNameL(CMsvEntry* aEntry, const TDesC16* aFileName)
    44 /**
    44 /**
    82 EXPORT_C  void CObexMtmFileNameExternaliser::Internalise1FileNameL(CMsvEntry* aEntry,  TDes16* aFileName)
    82 EXPORT_C  void CObexMtmFileNameExternaliser::Internalise1FileNameL(CMsvEntry* aEntry,  TDes16* aFileName)
    83 /**
    83 /**
    84 * Static function to read in one filename from the store.
    84 * Static function to read in one filename from the store.
    85 *
    85 *
    86 * @param aEntry entry to read the filename from
    86 * @param aEntry entry to read the filename from
    87 * @param aFileName Descriptor to receive the new filename. Any existing data will be overwritten. MUST be long enough to contain the name.
    87 * @param aFileName Descriptor to recieve the new filename. Any existing data will be overwritten. MUST be long enough to contain the name.
    88 * @leave KErrXXX system wide error codes.
    88 * @leave KErrXXX system wide error codes.
    89 */	
    89 */	
    90 	{
    90 	{
    91 	CMsvStore* messageStore = aEntry->ReadStoreL();
    91 	CMsvStore* messageStore = aEntry->ReadStoreL();
    92 	CleanupStack::PushL(messageStore);
    92 	CleanupStack::PushL(messageStore);
   163 */
   163 */
   164 	{
   164 	{
   165 	if(! iHaveCommitted)
   165 	if(! iHaveCommitted)
   166 		{
   166 		{
   167 		iMessageWriteStream.Close();  
   167 		iMessageWriteStream.Close();  
   168 		if(iMessageStore)
   168 		iMessageStore->Revert();  // Don't commit. Should have been called explicitly using CommitStoreL().
   169 		    iMessageStore->Revert();  // Don't commit. Should have been called explicitly using CommitStoreL().
       
   170 		}
   169 		}
   171 	delete iMessageStore;
   170 	delete iMessageStore;
   172 	delete iEntry;
   171 	delete iEntry;
   173 	}
   172 	}
   174 
   173