コード例 #1
0
void CClassB::ExternalizeL(RWriteStream& aStream) const
	{
	aStream << iFixBuffer;
	aStream.WriteInt32L(iIntValue);
	aStream.WriteUint32L(iUintValue);
	aStream.WriteReal64L(iRealValue);
	}  
コード例 #2
0
// -----------------------------------------------------------------------------
// 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() );
    }
コード例 #3
0
// -----------------------------------------------------------------------------
// CSyncMLFilterProperty::ExternalizeL
// Externalizes filter property.
// -----------------------------------------------------------------------------
EXPORT_C void CSyncMLFilterProperty::ExternalizeL( RWriteStream& aStream ) const
	{
	
	if ( iDisplayName )
		{
		aStream.WriteUint32L( iDisplayName->Length() );
		aStream << iDisplayName->Des();
		}
	else
		{
		aStream.WriteUint32L( 0 );	
		}
	
	// data type for default values
	aStream.WriteInt8L( ( TInt8 )iDataTypeForDefaultValues );
	
	// data type for query value
	aStream.WriteInt8L( ( TInt8 )iDataTypeForQueryValue );
	
	// max text length
	aStream.WriteUint32L( iMaxTextLength );
	
	// default values
	switch( iDataTypeForDefaultValues )
		{
		case ESyncMLDataTypeBool:
		case ESyncMLDataTypeNumber:
			{
			aStream.WriteInt32L( iDefaultValueIntOrBoolList.Count() );
			for ( TInt i = 0; i < iDefaultValueIntOrBoolList.Count(); i++ )
				{
				aStream.WriteInt32L( iDefaultValueIntOrBoolList[i] );
				}
			break;
			}
		case ESyncMLDataTypeTime:	
		case ESyncMLDataTypeDate:
			{
			aStream.WriteInt32L( iDefaultValueDateOrTimeList.Count() );
			for ( TInt i = 0; i < iDefaultValueDateOrTimeList.Count(); i++ )
				{
				aStream.WriteReal64L( 
				                ( iDefaultValueDateOrTimeList[i] )->Int64() );
				}
			break;
			}
			
		case ESyncMLDataTypeText8:
			{
			aStream.WriteInt32L( iDefaultValueText8List.Count() );
			for ( TInt i = 0; i < iDefaultValueText8List.Count(); i++ )
				{
				if ( iDefaultValueText8List[i] )
					{
					aStream.WriteUint32L( 
					                iDefaultValueText8List[i]->Length() );
					aStream << *iDefaultValueText8List[i];
					}
				else
					{
					aStream.WriteInt32L( 0 );
					}
				}
			break;
			}
			
		case ESyncMLDataTypeText16:
			{
			aStream.WriteInt32L( iDefaultValueText16List.Count() );
			for ( TInt i = 0; i < iDefaultValueText16List.Count(); i++ )
				{
				if ( iDefaultValueText16List[i] )
					{
					aStream.WriteUint32L( 
					                iDefaultValueText16List[i]->Length() );
					aStream << *iDefaultValueText16List[i];
					}
				else
					{
					aStream.WriteInt32L( 0 );
					}
				}
			break;
			}
		default:
			{
			aStream.WriteInt32L( 0 );
			break;
			}
		}
		
	// default values and query values
	switch( iDataTypeForQueryValue )
		{
		case ESyncMLDataTypeBool:
		case ESyncMLDataTypeNumber:
			{
			aStream.WriteInt32L( iQueryValueIntOrBool );
			break;
			}
		case ESyncMLDataTypeTime:	
		case ESyncMLDataTypeDate:
			{
			aStream.WriteReal64L( iQueryValueDateOrTime.Int64() );
			break;
			}
			
		case ESyncMLDataTypeText8:
			{
			if ( iQueryValueText8 )
				{
				aStream.WriteUint32L( iQueryValueText8->Length() );
				aStream << iQueryValueText8->Des();
				}	
			else
				{
				aStream.WriteUint32L( 0 );
				}	
			break;
			}
			
		case ESyncMLDataTypeText16:
			{
			if ( iQueryValueText16 )
				{
				aStream.WriteUint32L( iQueryValueText16->Length() );	
				aStream << iQueryValueText16->Des();
				}
			else
				{
				aStream.WriteUint32L( 0 );
				}			
			break;
			}
		default:
			{
			aStream.WriteInt32L( 0 );
			break;
			}
		}
	
	// default value selection
	aStream.WriteInt32L( iDefaultValueSelected.Count() );
	for ( TInt i = 0; i < iDefaultValueSelected.Count(); i++ )
		{
		aStream.WriteInt32L( iDefaultValueSelected[i] );
		}
		
	// can use query value
	aStream.WriteInt8L( iCanUseQueryValue );
	
	// supports multiple selection
	aStream.WriteInt8L( iSupportsMultpleSelection );
	
	// supports empty selection
	aStream.WriteInt8L( iSupportsEmptySelection );
	
	// query value selected
	aStream.WriteInt8L( iQueryValueSelected );
	
	}