emailservices/emailstore/message_store/server/src/MessageStoreSession.cpp
changeset 75 47d84de1c893
parent 65 478bc57ad291
child 76 38bf5461e270
equal deleted inserted replaced
72:64e38f08e49c 75:47d84de1c893
     1 /*
     1 /*
     2 * Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
     2 * Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). 
     3 * All rights reserved.
     3 * All rights reserved.
     4 * This component and the accompanying materials are made available
     4 * This component and the accompanying materials are made available
     5 * under the terms of "Eclipse Public License v1.0"
     5 * under the terms of "Eclipse Public License v1.0"
     6 * which accompanies this distribution, and is available
     6 * which accompanies this distribution, and is available
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
    76 // ==========================================================================
    76 // ==========================================================================
    77 // FUNCTION: ConstructL
    77 // FUNCTION: ConstructL
    78 // ==========================================================================
    78 // ==========================================================================
    79 void CSearchResult::ConstructL( const TDesC8& aPropertyBuf )
    79 void CSearchResult::ConstructL( const TDesC8& aPropertyBuf )
    80     {
    80     {
    81     iPropertyBuf.Create( aPropertyBuf );
    81     iPropertyBuf.CreateL( aPropertyBuf );
    82     }
    82     }
    83 
    83 
    84 // ==========================================================================
    84 // ==========================================================================
    85 // FUNCTION: Destructor
    85 // FUNCTION: Destructor
    86 // ==========================================================================
    86 // ==========================================================================
   684 	} // end DoGetEventsL
   684 	} // end DoGetEventsL
   685 	
   685 	
   686 // ==========================================================================
   686 // ==========================================================================
   687 // FUNCTION: SendEventToObserver
   687 // FUNCTION: SendEventToObserver
   688 // ==========================================================================
   688 // ==========================================================================
   689 void CMessageStoreSession::SendEventToObserver( TMsgStoreEvent aEvent )
   689 void CMessageStoreSession::SendEventToObserver( TMsgStoreEvent &aEvent )
   690 	{
   690 	{
   691 	__LOG_ENTER( "SendEventToObserver" )
   691 	__LOG_ENTER( "SendEventToObserver" )
   692 	
   692 	
   693 	// If there is no observer message pending then queue up the message,
   693 	// If there is no observer message pending then queue up the message,
   694 	// otherwise send it immediately.
   694 	// otherwise send it immediately.
  2554     TUint16 length16;
  2554     TUint16 length16;
  2555     TPckg<TUint16> length16Pckg( length16 );
  2555     TPckg<TUint16> length16Pckg( length16 );
  2556     
  2556     
  2557     RBuf8 addressBuf;
  2557     RBuf8 addressBuf;
  2558     CleanupClosePushL( addressBuf );
  2558     CleanupClosePushL( addressBuf );
  2559     addressBuf.Create( KInitialAddressBufSize );
  2559     addressBuf.CreateL( KInitialAddressBufSize );
  2560     
  2560     
  2561     RBuf8 dispNameBuf;
  2561     RBuf8 dispNameBuf;
  2562     CleanupClosePushL( dispNameBuf );
  2562     CleanupClosePushL( dispNameBuf );
  2563     dispNameBuf.Create( KInitialAddressBufSize );
  2563     dispNameBuf.CreateL( KInitialAddressBufSize );
  2564     
  2564     
  2565     TInt position = 0;
  2565     TInt position = 0;
  2566     while( position < bufSize )
  2566     while( position < bufSize )
  2567         {
  2567         {
  2568         //read the email address
  2568         //read the email address
  2569         aMessage.ReadL( 1, length16Pckg, position ); 
  2569         aMessage.ReadL( 1, length16Pckg, position ); 
  2570         position += length16Pckg.Length();
  2570         position += length16Pckg.Length();
  2571         
  2571         
  2572         if ( addressBuf.MaxLength() < length16 )
  2572         if ( addressBuf.MaxLength() < length16 )
  2573             {
  2573             {
  2574             addressBuf.ReAlloc( length16 );
  2574             addressBuf.ReAllocL( length16 );
  2575             }
  2575             }
  2576         aMessage.ReadL( 1, addressBuf, position );
  2576         aMessage.ReadL( 1, addressBuf, position );
  2577         
  2577         
  2578         //now read convert the 8 bit descriptor to 16 descriptor
  2578         //now read convert the 8 bit descriptor to 16 descriptor
  2579         const TUint16* addressPtr = reinterpret_cast<const TUint16*>( addressBuf.Ptr() );
  2579         const TUint16* addressPtr = reinterpret_cast<const TUint16*>( addressBuf.Ptr() );
  2585         aMessage.ReadL( 1, length16Pckg, position ); 
  2585         aMessage.ReadL( 1, length16Pckg, position ); 
  2586         position += length16Pckg.Length();
  2586         position += length16Pckg.Length();
  2587         
  2587         
  2588         if ( dispNameBuf.MaxLength() < length16 )
  2588         if ( dispNameBuf.MaxLength() < length16 )
  2589             {
  2589             {
  2590             dispNameBuf.ReAlloc( length16 );
  2590             dispNameBuf.ReAllocL( length16 );
  2591             }
  2591             }
  2592         aMessage.ReadL( 1, dispNameBuf, position );
  2592         aMessage.ReadL( 1, dispNameBuf, position );
  2593         
  2593         
  2594         //now read convert the 8 bit descriptor to 16 descriptor
  2594         //now read convert the 8 bit descriptor to 16 descriptor
  2595         const TUint16* dispNamePtr = reinterpret_cast<const TUint16*>( dispNameBuf.Ptr() );
  2595         const TUint16* dispNamePtr = reinterpret_cast<const TUint16*>( dispNameBuf.Ptr() );