contentstorage/cautils/src/caentriesarray.cpp
changeset 60 f62f87b200ec
equal deleted inserted replaced
4:1a2a00e78665 60:f62f87b200ec
       
     1 /*
       
     2  * Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies).
       
     3  * All rights reserved.
       
     4  * This component and the accompanying materials are made available
       
     5  * under the terms of "Eclipse Public License v1.0"
       
     6  * which accompanies this distribution, and is available
       
     7  * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8  *
       
     9  * Initial Contributors:
       
    10  * Nokia Corporation - initial contribution.
       
    11  *
       
    12  * Contributors:
       
    13  *
       
    14  * Description:  ?Description
       
    15  *
       
    16  */
       
    17 
       
    18 #include <s32mem.h>
       
    19 #include "caentriesarray.h"
       
    20 #include "cainnerentry.h"
       
    21 
       
    22 // ======== MEMBER FUNCTIONS ========
       
    23 
       
    24 // ---------------------------------------------------------------------------
       
    25 //
       
    26 // ---------------------------------------------------------------------------
       
    27 //
       
    28 EXPORT_C void RCaEntriesArray::ExternalizeL( RWriteStream& aStream ) const
       
    29     {
       
    30     aStream.WriteInt32L( Count() );
       
    31     for( TInt i = 0; i < Count(); i++ )
       
    32         {
       
    33         operator[]( i )->ExternalizeL( aStream );
       
    34         }
       
    35     aStream.CommitL();
       
    36     }
       
    37 
       
    38 // ---------------------------------------------------------------------------
       
    39 //
       
    40 // ---------------------------------------------------------------------------
       
    41 //
       
    42 EXPORT_C void RCaEntriesArray::InternalizeL( RReadStream& aStream )
       
    43     {
       
    44     ResetAndDestroy();
       
    45     TInt count = aStream.ReadInt32L();
       
    46     for( TInt i = 0; i < count; i++ )
       
    47         {
       
    48         CCaInnerEntry* entry = CCaInnerEntry::NewLC();
       
    49         entry->InternalizeL( aStream );
       
    50         AppendL( entry );
       
    51         CleanupStack::Pop( entry );
       
    52         }
       
    53     }