emailservices/emailstore/message_store/server/src/MessageStoreSession.cpp
branchRCL_3
changeset 16 b5fbb9b25d57
parent 10 f5907b1a1053
child 24 d189ee25cf9d
equal deleted inserted replaced
14:b13141f05c3d 16:b5fbb9b25d57
  2722     while( position < aMessage.GetDesLengthL( aIndex ) )
  2722     while( position < aMessage.GetDesLengthL( aIndex ) )
  2723         {
  2723         {
  2724         aMessage.ReadL( aIndex, length16Pckg, position );        
  2724         aMessage.ReadL( aIndex, length16Pckg, position );        
  2725         position += length16Pckg.Length();
  2725         position += length16Pckg.Length();
  2726         
  2726         
  2727         HBufC8* buf8 = HBufC8::NewL( length16 );            
  2727         HBufC8* buf8 = HBufC8::NewLC( length16 );            
  2728         aArray.Append( buf8 );
       
  2729         TPtr8 buf8Ptr( buf8->Des() );
  2728         TPtr8 buf8Ptr( buf8->Des() );
  2730         aMessage.ReadL( aIndex, buf8Ptr, position );
  2729         aMessage.ReadL( aIndex, buf8Ptr, position );
  2731         buf8->Des().SetLength( length16 ); 
  2730         buf8->Des().SetLength( length16 ); 
       
  2731         aArray.AppendL( buf8 );
       
  2732         CleanupStack::Pop(buf8);
  2732         position += length16;
  2733         position += length16;
  2733         } // end while
  2734         } // end while
  2734     }
  2735     }
  2735 
  2736 
  2736 // ==========================================================================
  2737 // ==========================================================================
  2753         aMessage.ReadL( aIndex, length16Pckg, position );        
  2754         aMessage.ReadL( aIndex, length16Pckg, position );        
  2754         position += length16Pckg.Length();
  2755         position += length16Pckg.Length();
  2755         
  2756         
  2756         if ( readBuf.MaxLength() < length16 )
  2757         if ( readBuf.MaxLength() < length16 )
  2757             {
  2758             {
  2758             readBuf.ReAlloc( length16 );
  2759             readBuf.ReAllocL( length16 );
  2759             }
  2760             }
  2760         aMessage.ReadL( aIndex, readBuf, position );
  2761         aMessage.ReadL( aIndex, readBuf, position );
  2761         
  2762         
  2762         //now read convert the 8 bit descriptor to 16 descriptor
  2763         //now read convert the 8 bit descriptor to 16 descriptor
  2763         const TUint16* valuePtr = reinterpret_cast<const TUint16*>( readBuf.Ptr() );
  2764         const TUint16* valuePtr = reinterpret_cast<const TUint16*>( readBuf.Ptr() );
  2764         TPtrC valueDes( valuePtr, length16 / 2 );  
  2765         TPtrC valueDes( valuePtr, length16 / 2 );  
  2765         
  2766         
  2766         aArray.Append( valueDes.AllocL() );
  2767         HBufC *p = valueDes.AllocLC();
       
  2768         aArray.AppendL( p );
       
  2769         CleanupStack::Pop( p );
  2767         
  2770         
  2768         position += length16;
  2771         position += length16;
  2769         } // end while
  2772         } // end while
  2770     
  2773     
  2771     CleanupStack::PopAndDestroy( &readBuf );
  2774     CleanupStack::PopAndDestroy( &readBuf );