283 { |
283 { |
284 sumSize += (*itemArray)[i].Size(); |
284 sumSize += (*itemArray)[i].Size(); |
285 } |
285 } |
286 HBufC8* buf8 = HBufC8::NewLC( sizeof(TInt) // For active index |
286 HBufC8* buf8 = HBufC8::NewLC( sizeof(TInt) // For active index |
287 + sizeof(TInt) // For the count of item array |
287 + sizeof(TInt) // For the count of item array |
|
288 + sizeof(TInt) // langcode |
288 + sizeof(TInt)*( itemArray->Count() ) // For the size of each item |
289 + sizeof(TInt)*( itemArray->Count() ) // For the size of each item |
289 + sumSize// For all of char data |
290 + sumSize// For all of char data |
290 ); |
291 ); |
291 TPtr8 buf8Ptr = buf8->Des(); |
292 TPtr8 buf8Ptr = buf8->Des(); |
292 RDesWriteStream writeStream; |
293 RDesWriteStream writeStream; |
293 CleanupClosePushL(writeStream); |
294 CleanupClosePushL(writeStream); |
294 writeStream.Open( buf8Ptr ); |
295 writeStream.Open( buf8Ptr ); |
295 writeStream.WriteInt32L( candidatelist->iActiveIndex ); |
296 writeStream.WriteInt32L( candidatelist->iActiveIndex ); |
296 writeStream.WriteInt32L( itemArray->Count() ); |
297 writeStream.WriteInt32L( itemArray->Count() ); |
|
298 writeStream.WriteInt32L( candidatelist->iLangCode ); |
|
299 |
297 for ( TInt i = 0; i < itemArray->Count(); i++ ) |
300 for ( TInt i = 0; i < itemArray->Count(); i++ ) |
298 { |
301 { |
299 writeStream.WriteInt32L( (*itemArray)[i].Size() ); |
302 writeStream.WriteInt32L( (*itemArray)[i].Size() ); |
300 writeStream.WriteL( (*itemArray)[i].Ptr(), (*itemArray)[i].Length() ); |
303 writeStream.WriteL( (*itemArray)[i].Ptr(), (*itemArray)[i].Length() ); |
301 } |
304 } |