contentstorage/cautils/src/cainnerquery.cpp
changeset 88 7f0462e8c3da
parent 86 e492551a0d54
child 89 1e87eb3b400f
equal deleted inserted replaced
87:9d806967057c 88:7f0462e8c3da
    28 //
    28 //
    29 CCaInnerQuery::~CCaInnerQuery()
    29 CCaInnerQuery::~CCaInnerQuery()
    30     {
    30     {
    31     delete iEntryTypeNames;
    31     delete iEntryTypeNames;
    32     iIds.Close();
    32     iIds.Close();
       
    33     iAttributes.ResetAndDestroy();
    33     }
    34     }
    34 
    35 
    35 // ---------------------------------------------------------------------------
    36 // ---------------------------------------------------------------------------
    36 //
    37 //
    37 // ---------------------------------------------------------------------------
    38 // ---------------------------------------------------------------------------
    79         {
    80         {
    80         aStream.WriteInt32L( iEntryTypeNames->MdcaPoint( i ).Length() );
    81         aStream.WriteInt32L( iEntryTypeNames->MdcaPoint( i ).Length() );
    81         aStream.WriteL( iEntryTypeNames->MdcaPoint( i ),
    82         aStream.WriteL( iEntryTypeNames->MdcaPoint( i ),
    82                 iEntryTypeNames->MdcaPoint( i ).Length() );
    83                 iEntryTypeNames->MdcaPoint( i ).Length() );
    83         }
    84         }
       
    85     iAttributes.ExternalizeL( aStream );
       
    86     aStream.CommitL();
    84     }
    87     }
    85 
    88 
    86 // ---------------------------------------------------------------------------
    89 // ---------------------------------------------------------------------------
    87 //
    90 //
    88 // ---------------------------------------------------------------------------
    91 // ---------------------------------------------------------------------------
   112         buf.CreateL( length );
   115         buf.CreateL( length );
   113         aStream.ReadL( buf, length );
   116         aStream.ReadL( buf, length );
   114         iEntryTypeNames->AppendL( buf );
   117         iEntryTypeNames->AppendL( buf );
   115         CleanupStack::PopAndDestroy( &buf );
   118         CleanupStack::PopAndDestroy( &buf );
   116         }
   119         }
       
   120     iAttributes.InternalizeL( aStream );
   117     }
   121     }
   118 
   122 
   119 // ---------------------------------------------------------------------------
   123 // ---------------------------------------------------------------------------
   120 //
   124 //
   121 // ---------------------------------------------------------------------------
   125 // ---------------------------------------------------------------------------
   300 //
   304 //
   301 EXPORT_C TUint CCaInnerQuery::GetCount() const
   305 EXPORT_C TUint CCaInnerQuery::GetCount() const
   302     {
   306     {
   303     return iCount;
   307     return iCount;
   304     }
   308     }
       
   309 
       
   310 // ---------------------------------------------------------------------------
       
   311 //
       
   312 // ---------------------------------------------------------------------------
       
   313 //
       
   314 EXPORT_C void CCaInnerQuery::AddAttributeL( const TDesC& aKey,
       
   315         const TDesC& aValue )
       
   316     {
       
   317     // to avoid duplicated attribute
       
   318     if( iAttributes.Exist( aKey ) )
       
   319         {
       
   320         iAttributes.RemoveAttribute( aKey );
       
   321         }
       
   322     CCaEntryAttribute* attr = CCaEntryAttribute::NewLC( aKey );
       
   323     attr->SetValueL( aValue );
       
   324     iAttributes.AppendL( attr );
       
   325     CleanupStack::Pop( attr );
       
   326     }
       
   327 
       
   328 // ---------------------------------------------------------------------------
       
   329 //
       
   330 // ---------------------------------------------------------------------------
       
   331 //
       
   332 EXPORT_C const RCaEntryAttrArray& CCaInnerQuery::GetAttributes() const
       
   333     {
       
   334     return iAttributes;
       
   335     }