Esempio n. 1
0
/*static*/ void PbapDTD::WriteBeginL(RWriteStream& aWriteStream)
	{
	LOG_STATIC_FUNC
	aWriteStream.WriteL(KXMLVersion);
	aWriteStream.WriteL(KXMLDocType);
	aWriteStream.WriteL(KXMLBegin);		
	}
//-----------------------------------------------------------------------------
// CCFActionIndicationImpl::ExternalizeL
//-----------------------------------------------------------------------------
//
EXPORT_C void CCFActionIndicationImpl::ExternalizeL( RWriteStream& aStream )
    {
    FUNC_LOG;
    
    // Identifier
    aStream.WriteInt16L( iIdentifier->Length() );
    aStream.WriteL( *iIdentifier );
    
    // Parameters
    TPtrC buf( KNullDesC );
    TInt count = iParameters.Count();
    aStream.WriteInt16L( count );
    for( TInt i = 0; i < count; i++ )
        {
        // Key length and data
        buf.Set( iParameters[i]->Key() );
        aStream.WriteInt16L( buf.Length() );
        aStream.WriteL( buf, buf.Length() );
        
        // Value length and data
        buf.Set( iParameters[i]->Value() );
        aStream.WriteInt16L( buf.Length() );
        aStream.WriteL( buf, buf.Length() );
        }
    
    // Commit stream
    aStream.CommitL();
    }
/**
Intended Usage	: Stream out the internal state to aStream.	

Error Condition	: Leave with the error code.
@leave  		KErrNoMemory.
@leave  		@see RWriteStream.
@since			7.0
@param			aClientSide a boolean indicating whether the streaming is to performed in client/server side
@param			aStream The stream to store the data in.
@pre 			CImplementationInformation is fully constructed and initialized
*/
void CImplementationInformation::ExternalizeL(TBool aClientSide,RWriteStream& aStream) const
	{
	aStream.WriteInt32L(iImplementationUid.iUid);
	aStream.WriteInt32L(iVersion);
	if(iDisplayName)
		{
		TPtr outputBuf = iDisplayName->Des();
		aStream.WriteInt32L(outputBuf.Length());
		aStream.WriteL(outputBuf);
		}
	else
		{
		aStream.WriteInt32L(0);
		}

	if(iData)
		{
		TPtr8 outputBuf = iData->Des();
		aStream.WriteInt32L(outputBuf.Length());
		aStream.WriteL(outputBuf);
		}
	else
		{
		aStream.WriteInt32L(0);
		}

	if(iOpaqueData)
		{
		TPtr8 outputBuf = iOpaqueData->Des();
		aStream.WriteInt32L(outputBuf.Length());
		aStream.WriteL(outputBuf);
		}
	else
		{
		aStream.WriteInt32L(0);
		}
	if (aClientSide)
		{
		aStream.WriteInt32L(iDrive);		
		aStream.WriteInt32L(iVid.iId);		
		}
	TInt additionalImplInfo=iRomOnly;
	additionalImplInfo|=iRomBased<<1;
	additionalImplInfo|=iDisabled<<2;
	aStream.WriteInt8L(additionalImplInfo);
	
	if (iExtendedInterfaceList != NULL)
		{
		TInt count = iExtendedInterfaceList->Count();
		aStream.WriteInt32L(count);
		for(TInt i = 0; i < count; ++i)
			{
	   		aStream.WriteInt32L((*iExtendedInterfaceList)[i].iUid);
			}
		}
	else
		{
		aStream.WriteInt32L(KNoneExtendedInterface);
		}
	}
// -----------------------------------------------------------------------------
// CHttpCacheEntry::Externalize
//
// -----------------------------------------------------------------------------
//
void CHttpCacheEntry::ExternalizeL( RWriteStream& aWriteStream, const TDesC& aDirectory )
    {
    // check directory matches filename
    ASSERT(aDirectory.CompareF(iFileName->Left(aDirectory.Length())) == 0);

    // url length
    aWriteStream.WriteInt32L( iUrl->Length() );
    // url
    aWriteStream.WriteL( iUrl->Des() );
    // filename
    // know that filenames are 8 chars and no extension. Can reconstruct on
    // import from directory and last char. See HttpCacheUtil::GenerateNameLC.
    aWriteStream.WriteL( iFileName->Des().Right( KFilenameLength ) );
    // la
    aWriteStream.WriteReal64L( iLastAccessed );
    // ref
    aWriteStream.WriteUint32L( iRef );
    // size
    aWriteStream.WriteUint32L( iBodySize );
    // size
    aWriteStream.WriteUint32L( iHeaderSize );
    // protected
    aWriteStream.WriteInt32L( iProtected );
    // header data length
    aWriteStream.WriteInt32L( iHeaderBuffer->Length() );
    // header data
    aWriteStream.WriteL( iHeaderBuffer->Des() );
    }
void CDeploymentComponentData::SerializedFormL(RWriteStream &aBuffer) const
    {
    aBuffer.WriteUint32L(iDataFileName.Length() );
    aBuffer.WriteL(iDataFileName);

    aBuffer.WriteUint32L(iMimeType.Length() );
    aBuffer.WriteL(iMimeType);

    }
void CQueueEntry::ExternalizeL( RWriteStream& aStream )
    {
    if( iUrl )
        {
        aStream.WriteInt32L( iUrl->Length( ) );
        aStream.WriteL( *iUrl, iUrl->Length( ) );         
        }
     else
        aStream.WriteInt32L( 0 );

    if( iTitle )
        {
        aStream.WriteInt32L( iTitle->Length( ) );
        aStream.WriteL( *iTitle, iTitle->Length( ) ); 
        }
     else
        aStream.WriteInt32L( 0 );

    if( iTags )
        {
        aStream.WriteInt32L( iTags->Length( ) );
        aStream.WriteL( *iTags, iTags->Length( ) ); 
        }
     else
        aStream.WriteInt32L( 0 );

    if( iDescription )
        {
        aStream.WriteInt32L( iDescription->Length( )  );
        aStream.WriteL( *iDescription, iDescription->Length( ) ); 
        }
     else
        aStream.WriteInt32L( 0 );

    aStream.WriteInt32L( iFilename.Length( ) );
    aStream.WriteL( iFilename, iFilename.Length( ) ); 

    aStream.WriteInt32L( iType );

    // in case of aborted transaction
	if( (iStatus == CQueueEntry::EEntryInitializing) || (iStatus == CQueueEntry::EEntryUploading) 
	    || (iStatus == CQueueEntry::EEntryDownloading) )
    	{
        aStream.WriteInt32L( CQueueEntry::EEntryQueued );
    	}
    else
        aStream.WriteInt32L( iStatus );

    aStream.WriteInt32L( iCategory );

    aStream.WriteInt32L( iPublic );

    aStream.WriteInt32L( iSize );

    aStream.WriteInt32L( iUid );
    }
void CTestContextData::ExternalizeL( RWriteStream& aStream )
    {
    TPtrC keyPtr( *iKey );
    aStream.WriteInt16L( keyPtr.Length() );
    aStream.WriteL( keyPtr, keyPtr.Length() );

    TPtrC valuePtr( *iValue );
    aStream.WriteInt16L( valuePtr.Length() );
    aStream.WriteL( valuePtr, valuePtr.Length() );
    }
// ---------------------------------------------------------------------------
// CCaInnerIconDescription::ExternalizeL
// ---------------------------------------------------------------------------
//
void CCaInnerIconDescription::ExternalizeL( RWriteStream& aStream ) const
    {
    aStream.WriteInt32L( iId );
    aStream.WriteUint32L( iFileName.Length() );
    aStream.WriteL( iFileName, iFileName.Length() );
    aStream.WriteUint32L( iSkinId.Length() );
    aStream.WriteL( iSkinId, iSkinId.Length() );
    aStream.WriteUint32L( iApplicationId.Length() );
    aStream.WriteL( iApplicationId, iApplicationId.Length() );
    aStream.CommitL();
    }
// -----------------------------------------------------------------------------
// CSdpRepeatField::EncodeL
// Writes attributes in proper format to the stream
// -----------------------------------------------------------------------------
//
EXPORT_C void CSdpRepeatField::EncodeL(RWriteStream& aStream) const
    {
    const TDesC8& repeatName = iPool.StringF(SdpCodecStringConstants::ERepeat, 
                                        SdpCodecStringConstants::Table).DesC();
    aStream.WriteL(repeatName);
    iRepeatInterval.EncodeL(aStream);
    aStream.WriteL(KSPStr);
    iActiveDuration.EncodeL(aStream);
    for (TInt i = 0; i < iTimeOffsets.Count(); i++)
        {
        aStream.WriteL(KSPStr);
        (iTimeOffsets)[i].EncodeL(aStream);
        }
    aStream.WriteL(KCRLFStr);
    }
Esempio n. 10
0
// ---------------------------------------------------------------------------
// SdpUtil::EncodeBufferL
// Encodes headername and a value to the stream
// ---------------------------------------------------------------------------
//
void SdpUtil::EncodeBufferL(
    const TDesC8& aValue, 
    TInt aIndex,
    RWriteStream& aStream )
	{
	if( aValue.Length() != 0 )
		{
        RStringPool pool = SdpCodecStringPool::StringPoolL();
		RStringF headername = pool.StringF( aIndex, 
                                        SdpCodecStringPool::StringTableL() );
		aStream.WriteL( headername.DesC() );
		aStream.WriteL( aValue );
		aStream.WriteL( KCRLFStr );
		}
	}
/** implementation of inherited externalization function */
void CLbsTransmitLocationLogEvent::DoExternalizeL(RWriteStream& aWriteStream) const
	{
	aWriteStream.WriteInt32L(iX3PApp.iUid);
	aWriteStream.WriteInt32L(iDestination.Length());
	aWriteStream.WriteL(iDestination.Ptr(), iDestination.Length());
	WritePosInfo(aWriteStream, iPosInfo);
	}
Esempio n. 12
0
// -----------------------------------------------------------------------------
// CDRMXOma::WriteInt64L
// -----------------------------------------------------------------------------
//
void CDRMXOma::WriteInt64L( const TInt64& aWrite, RWriteStream& aStream ) const
    {
    TPtr8 output( reinterpret_cast<TUint8*>(const_cast<TInt64*>(&aWrite)), 
                  sizeof(TInt64), sizeof(TInt64) );
        
    aStream.WriteL( output, sizeof(TInt64) );
    }
// ------------------------------------------------------------------------------------------------
// CNSmlDPInformation::ExternalizeL
// ------------------------------------------------------------------------------------------------
EXPORT_C void CNSmlDPInformation::ExternalizeL( RWriteStream& aStream ) const
	{
	TPckgC<TSmlDataProviderId> id( iInfo->iId );
	aStream.WriteL( id );
	
	//version
	aStream.WriteInt32L( iInfo->iVersion.iMajor );
	aStream.WriteInt32L( iInfo->iVersion.iMinor );
	aStream.WriteInt32L( iInfo->iVersion.iBuild );
	
	aStream.WriteInt32L( iInfo->iProtocolVer );
	
	aStream.WriteUint32L( iInfo->iDisplayName->Length() );
	aStream << *iInfo->iDisplayName;
	
	TInt mimetypesCount( iInfo->iMimeTypes->Count() );
	aStream.WriteUint32L( mimetypesCount );
	
	for (TInt i = 0; i < mimetypesCount; i++ )
		{
		const TDesC8& mimetype = (*iInfo->iMimeTypes)[i];
		aStream.WriteUint32L( mimetype.Length() );
		aStream << mimetype;
		}
		
	TInt mimeversCount( iInfo->iMimeVersions->Count() );
	aStream.WriteUint32L( mimeversCount );
	
	for (TInt i = 0; i < mimeversCount; i++ )
		{
		const TDesC8& mimever = (*iInfo->iMimeVersions)[i];
		aStream.WriteUint32L( mimever.Length() );
		aStream << mimever;
		}
	}
Esempio n. 14
0
void TTcSettings::doStoreL( RWriteStream& aStream )
	{
	aStream.WriteInt16L( KTcSettingsVersion );
	// Write bearer selection
	aStream.WriteInt32L( iBearerType );
	// Write autoconnect selection
	aStream.WriteInt16L( iAutoConnect );
	// Write TCP port selection
	aStream.WriteInt16L( iTCPPort );
	// Write IAP iD
	aStream.WriteInt16L( iIAPId );
	// Write CSY name
	aStream.WriteInt32L( iCSYName );
	// Write comms port name
	aStream.WriteInt32L( iCommPort );
	// Write baudrate of comms
	aStream.WriteInt32L( iBaudrate );
	// Write first run flag
	aStream.WriteInt16L( iIsFirstRun );
	
	// Write remote tcp address as string
	TBuf<40> buf;
	iTCPRemoteAddr.Output(buf);
	
	//write length first
	aStream.WriteInt16L( buf.Length() );
	aStream.WriteL(buf);
		
	}
void CPosLmNameIndex::CIndexItem::ExternalizeL( RWriteStream& aOut ) const
    {
    aOut.WriteUint32L( iId );
    aOut.WriteUint32L( Name().Length() );
    aOut.WriteL( Name() );
    // state is not stored, it is used only for index verification
    }
Esempio n. 16
0
// ----------------------------------------------------------------------------
// CURIContainer::ExternalizeL
// ----------------------------------------------------------------------------
//
EXPORT_C void CURIContainer::ExternalizeL(RWriteStream& aWriteStream) const
{
    if(IsSIPURI())
    {
        HBufC8* tmp = iSIPURI->ToTextL();
        CleanupStack::PushL(tmp);
        aWriteStream.WriteUint32L(tmp->Des().Length());
        aWriteStream.WriteL(tmp->Des());
        CleanupStack::PopAndDestroy(tmp);
    }
    else
    {
        TPtrC8 uri8(iUri8->Uri().UriDes());
        aWriteStream.WriteUint32L(uri8.Length());
        aWriteStream.WriteL(uri8);
    }
}
Esempio n. 17
0
EXPORT_C void TAppInfo::ExternalizeL(RWriteStream& aStream) const
	{
	_LIT(KEmptyString, "");
	
	aStream << (iAppName ? *iAppName : KEmptyString());
	aStream << (iAppVendor ? *iAppVendor : KEmptyString());
	aStream.WriteL(TPckgC<TVersion>(iAppVersion));
	}
// -----------------------------------------------------------------------------
// CExtensionDescrParam::ExternalizeL
// -----------------------------------------------------------------------------
//
void CExtensionDescrParam::ExternalizeL(RWriteStream& aWriteStream) const
	{
	__ASSERT_ALWAYS(iValue != NULL, User::Leave(KErrNotFound));

	aWriteStream.WriteUint32L(iID);
	aWriteStream.WriteInt32L(iValue->Length());
	aWriteStream.WriteL(*iValue);
	}
Esempio n. 19
0
// -----------------------------------------------------------------------------
// TSdpTypedTime::EncodeL
// Writes attributes in proper format to the stream
// -----------------------------------------------------------------------------
//
void TSdpTypedTime::EncodeL(RWriteStream& aStream) const
    {
    TBuf8<KMaxTInt64Digits> number;
    number.AppendNum( iValue );
	aStream.WriteL( number );

    RStringPool pool = SdpCodecStringPool::StringPoolL();
    const TDesC8& timeDays = pool.StringF(
                                    SdpCodecStringConstants::ETimeUnitDays,
                                    SdpCodecStringConstants::Table).DesC();
    const TDesC8& timeHours = pool.StringF(
                                    SdpCodecStringConstants::ETimeUnitHours,
                                    SdpCodecStringConstants::Table).DesC();
    const TDesC8& timeMinutes = pool.StringF(
                                    SdpCodecStringConstants::ETimeUnitMinutes,
                                    SdpCodecStringConstants::Table).DesC();
    const TDesC8& timeSeconds = pool.StringF(
                                    SdpCodecStringConstants::ETimeUnitSeconds,
                                    SdpCodecStringConstants::Table).DesC();

    if (iUnit != ETimeUnitNone)
        {
        TBuf8<1> unit;
        if (iUnit == ETimeUnitDays)
            {
            unit.Append(timeDays);
            }
        else if (iUnit == ETimeUnitHours)
            {
            unit.Append(timeHours);
            }
        else if (iUnit == ETimeUnitMinutes)
            {
            unit.Append(timeMinutes);
            }
        else if (iUnit == ETimeUnitSeconds)
            {
            unit.Append(timeSeconds);
            }
        else
            {}

        aStream.WriteL(unit);
        }
    }
Esempio n. 20
0
// -----------------------------------------------------------------------------
// CDRMConstraint::WriteInt64L
// -----------------------------------------------------------------------------
//
void CDRMConstraint::WriteInt64L( const TInt64& aWrite, RWriteStream& aStream ) const
    {
    TPtr8 output(NULL,0,0);

    output.Set( reinterpret_cast<TUint8*>(const_cast<TInt64*>(&aWrite)),
                sizeof(TInt64), sizeof(TInt64) );

    aStream.WriteL( output, sizeof(TInt64) );
    };
Esempio n. 21
0
//
// Test copying from one stream to another.
//
//
//
LOCAL_C void testCopyL(RWriteStream& aWriteStream,RReadStream& aReadStream)
	{
	test.Next(_L("Copying"));
	for (TInt i=KTestLength;i>=0;--i)
		{
		aWriteStream.WriteL(aReadStream,i);
		aReadStream.ReadL(aWriteStream,KTestLength-i);
		}
	}
Esempio n. 22
0
// -----------------------------------------------------------------------------
// WriteArrayToStreamL
// Write the array to the stream
// -----------------------------------------------------------------------------
//
LOCAL_C void WriteArrayToStreamL( RWriteStream& aStream,
                                  const RPointerArray<HBufC8>& aArray )
    {
    for(TInt i = 0; i < aArray.Count(); i++ )
        {
        aStream.WriteInt32L( aArray[i]->Size() );
        aStream.WriteL( aArray[i]->Des() );
        }
    }
Esempio n. 23
0
// ---------------------------------------------------------------------------
//
// ---------------------------------------------------------------------------
//
EXPORT_C void CCaInnerEntry::ExternalizeL( RWriteStream& aStream ) const
    {
    aStream.WriteInt32L( iId );
    aStream.WriteInt32L( iUid );
    aStream.WriteUint32L( iFlags );
    aStream.WriteUint32L( iRole );
    aStream.WriteUint32L( iText.Length() );
    aStream.WriteL( iText, iText.Length() );
    aStream.WriteUint32L( iDescription.Length() );
    aStream.WriteL( iDescription, iDescription.Length() );
    aStream.WriteUint32L( iEntryTypeName.Length() );
    aStream.WriteL( iEntryTypeName, iEntryTypeName.Length() );
    aStream.WriteUint32L( iTextLocalized );
    aStream.WriteUint32L( iDescriptionLocalized );
    iAttributes.ExternalizeL( aStream );
    iIcon->ExternalizeL( aStream );
    aStream.CommitL();
    }
Esempio n. 24
0
EXPORT_C void CBitset::ExternalizeL(RWriteStream& aStream) const
	{
	// Write the max-Id
	aStream.WriteInt32L(iMaxBits);
	// Create a descriptor to encapsulate the set
	TPtrC8 ptr(iBitSet, iWidth);
	// Write the descriptor
	aStream.WriteL(ptr);
	}
Esempio n. 25
0
/**
@SYMTestCaseID          SYSLIB-STORE-CT-1195
@SYMTestCaseDesc	    Copying from one stream to another stream test
@SYMTestPriority 	    High
@SYMTestActions  	    Attempt for copying two streams
@SYMTestExpectedResults Test must not fail
@SYMREQ                 REQ0000
*/
LOCAL_C void testCopyL(RWriteStream& aWriteStream,RReadStream& aReadStream)
	{
	test.Next(_L(" @SYMTestCaseID:SYSLIB-STORE-CT-1195 Copying "));
	for (TInt i=KTestLength;i>=0;--i)
		{
		aWriteStream.WriteL(aReadStream,i);
		aReadStream.ReadL(aWriteStream,KTestLength-i);
		}
	}
//-----------------------------------------------------------------------------
// CCFActionSubscriptionImpl::ExternalizeL
//-----------------------------------------------------------------------------
//
EXPORT_C void CCFActionSubscriptionImpl::ExternalizeL( RWriteStream& aStream )
    {
    FUNC_LOG;
    
    aStream.WriteInt16L( iIdentifier->Length() );
    aStream.WriteL( *iIdentifier, iIdentifier->Length() );

    // Commit stream
    aStream.CommitL();
    }
// -----------------------------------------------------------------------------
// CSdpConnectionField::ExternalizeL
// Externalizes the object to stream
// -----------------------------------------------------------------------------
//
void CSdpConnectionField::ExternalizeL(
    RWriteStream& aStream ) const
    {
    __TEST_INVARIANT;

    // Address
    aStream.WriteUint32L( iAddress->Des().Length() );
    aStream.WriteL( iAddress->Des(), iAddress->Des().Length() );
    // TTL
    aStream.WriteInt32L( iTTL );
    // Number of addresses
    aStream.WriteInt32L( iNumOfAddress );
    // <network type>
    aStream.WriteUint32L( iNetType.DesC().Length() );
    aStream.WriteL( iNetType.DesC() );
    // <address type>
    aStream.WriteUint32L( iAddressType.DesC().Length() );
    aStream.WriteL( iAddressType.DesC() );
    }
// ----------------------------------------------------------------------------
// CSIPSubscriptionStateHeader::ExternalizeValueL
// From CSIPHeaderBase:
// ----------------------------------------------------------------------------
//
void CSIPSubscriptionStateHeader::ExternalizeValueL(
    RWriteStream& aWriteStream) const
	{
	aWriteStream.WriteUint32L (iSubStateValue->Length());
	if (iSubStateValue->Length() > 0)
		{
		aWriteStream.WriteL (SubStateValue());
		}
	iParams->ExternalizeL (aWriteStream);
	}
Esempio n. 29
0
// ----------------------------------------------------------------------------
// CSdpMediaField::ExternalizeL
// ----------------------------------------------------------------------------
//
void CSdpMediaField::ExternalizeL(RWriteStream& aStream) const
{
    aStream.WriteUint32L (iMedia.DesC().Length());
    if (iMedia.DesC().Length() > 0)
    {
        aStream.WriteL (iMedia.DesC());
    }
    aStream.WriteUint32L (iPort);
    if(iPortCount)
    {
        aStream.WriteUint8L (1);
        aStream.WriteUint32L (iPortCount);
    }
    else
    {
        aStream.WriteUint8L (0);
    }
    aStream.WriteUint32L (iProtocol.DesC().Length());
    if (iProtocol.DesC().Length() > 0)
    {
        aStream.WriteL (iProtocol.DesC());
    }
    aStream.WriteUint32L (iFormatList->Length());
    if (iFormatList->Length() > 0)
    {
        aStream.WriteL (*iFormatList);
    }
    aStream.WriteUint32L (iInfo->Length());
    if (iInfo->Length() > 0)
    {
        aStream.WriteL (*iInfo);
    }
    SdpCodecTemplate<CSdpConnectionField>::ExternalizeArrayL(*iConnectionFields,
            aStream);
    SdpCodecTemplate<CSdpBandwidthField>::ExternalizeArrayL(*iBandwidthFields,
            aStream);
    SdpCodecTemplate<CSdpKeyField>::ExternalizeL(Key(), aStream);
    SdpCodecTemplate<CSdpAttributeField>::ExternalizeArrayL(*iAttributeFields,
            aStream);
    SdpCodecTemplate<CSdpFmtAttributeField>::ExternalizeArrayL(*iFmtAttrFields,
            aStream);
}
Esempio n. 30
0
// ---------------------------------------------------------------------------
// ---------------------------------------------------------------------------
//
void CWlanSsidList::ExternalizeL(
    RWriteStream& aStream) const
    {
    aStream.WriteInt32L( iSsidList.Count() );
    for( TInt idx( 0 ); idx < iSsidList.Count(); ++idx )
        {
        aStream.WriteInt8L(
            iSsidList[idx].Length() );
        aStream.WriteL(
            iSsidList[idx] );        
        }        
    }