// -----------------------------------------------------------------------------
// CMmsElementDescriptor::Externalize
// -----------------------------------------------------------------------------
//
void CMmsElementDescriptor::ExternalizeL( RMsvWriteStream& aStream  ) const
    {
    TInt32 length = 0;
    length = ContentReference().Length(); 
    aStream.WriteInt32L( length );
    if ( length > 0 )
        {
        aStream << ContentReference();
        }

    length = 0;
    length = ContentType().Length();
    aStream.WriteInt32L( length );
    if ( length > 0 )
        {
        aStream << ContentType();
        }
    }
Пример #2
0
EXPORT_C void CImOffLineArrayStore::ExternalizeL(RMsvWriteStream& aWriteStream) const
    {
    TInt nr = iArray->CountOperations();
    aWriteStream.WriteUint16L(iVersion);
    aWriteStream.WriteInt32L(nr);
    
    TInt i;
    for ( i = 0 ; i < nr ; i++)
        {
        iArray->Operation( i ).ExternalizeL(aWriteStream);
        }
    }
Пример #3
0
// Static functions that do the whole process in one go:
EXPORT_C  void CObexMtmFileNameExternaliser::ExternaliseAndCommit1FileNameL(CMsvEntry* aEntry, const TDesC16* aFileName)
/**
* Static function to write one and only one filename to the message store, then finalise and commit it. This function
* should be called ONCE ONLY. To externalise more than one filename, instantiate this class and use ExternaliseFileNameL()
* followed by CommitStoreL().
* @param aEntry the entry whose store is to be written to
* @param aFileName The filename to write to the store
* @leave KErrXXX system-wide error codes
*/	
	{
	CMsvStore* messageStore = aEntry->EditStoreL();
	CleanupStack::PushL(messageStore);

	RMsvWriteStream messageWriteStream;
	CleanupClosePushL(messageWriteStream);

	messageWriteStream.AssignL(*messageStore, KObexFileNameStreamUid);

	// write the identifier so we know we are internalizing a stream later
#ifndef TEST_INC042468
	messageWriteStream.WriteInt32L(KObexFileNameStreamFileNameUid);
#endif
	messageWriteStream.WriteInt32L(aFileName->Length());  
	messageWriteStream.WriteL(*aFileName);

#ifndef TEST_INC042468
	messageWriteStream.WriteInt32L(KObexFileNameStreamFileNameUid);
#endif
	messageWriteStream.WriteInt32L(0);		//Mark the end of the filename list

	messageWriteStream.CommitL();

	CleanupStack::PopAndDestroy(); // trigger a call to Close(); on messageWriteStream as well as removing from the stack

	messageStore->CommitL();
	CleanupStack::PopAndDestroy(messageStore);
	}
Пример #4
0
EXPORT_C void CImOffLineOperation::ExternalizeL( RMsvWriteStream& aWriteStream ) const
	{
    aWriteStream.WriteInt32L(iOpType);
    aWriteStream.WriteInt32L(iMessageId);
    aWriteStream.WriteInt32L(iTargetMessageId);
    aWriteStream.WriteInt32L(iMtmFunctionId);

    if (iMtmParameters)
        {
        TInt length = iMtmParameters->Length();
        aWriteStream.WriteInt32L(length);
        if (length > 0)
            aWriteStream << TPtrC8(*iMtmParameters);
        }
    else
        {
        aWriteStream.WriteInt32L(0);
        }
	return;
	}