sapi_applicationmanager/src/appinfomap.cpp
changeset 0 14df0fbfcc4e
equal deleted inserted replaced
-1:000000000000 0:14df0fbfcc4e
       
     1 /*
       
     2 * Copyright (c) 2007-2007 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 the License "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:  Implements CLiwIterable type
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #include "appinfomap.h"
       
    20 #include "appmanagerservice.h"
       
    21 
       
    22 
       
    23 
       
    24 
       
    25 // ---------------------------------------------------------------------------
       
    26 // CAppInfoMap::NewL
       
    27 // Two-phased constructor
       
    28 // ---------------------------------------------------------------------------
       
    29 //
       
    30 
       
    31 CAppInfoMap* CAppInfoMap::NewL( MInfoMap* aMap )
       
    32     {
       
    33     return new( ELeave ) CAppInfoMap( aMap );
       
    34     }
       
    35 
       
    36 
       
    37 // ---------------------------------------------------------------------------
       
    38 // CAppInfoMap::~CAppInfoMap
       
    39 // Class destructor
       
    40 // ---------------------------------------------------------------------------
       
    41 //
       
    42 CAppInfoMap::~CAppInfoMap()
       
    43     {
       
    44 
       
    45 	delete iMap;
       
    46 
       
    47 	}
       
    48 // ---------------------------------------------------------------------------
       
    49 // CAppInfoMap::FindL
       
    50 // ---------------------------------------------------------------------------
       
    51 
       
    52 TBool CAppInfoMap::FindL(const TDesC8& aKey, TLiwVariant& aFndValue) const
       
    53     {
       
    54     
       
    55     
       
    56     TPtrC val;
       
    57     if ( iMap->FindL(aKey, val ) )
       
    58         {
       
    59         aFndValue.Set( val );
       
    60         return ETrue;
       
    61         }
       
    62     else
       
    63         {
       
    64          return EFalse;
       
    65         }
       
    66    
       
    67     }
       
    68  
       
    69 // ---------------------------------------------------------------------------
       
    70 // CAppInfoMap::Count
       
    71 // ---------------------------------------------------------------------------
       
    72     
       
    73 TInt CAppInfoMap::CAppInfoMap::Count() const 
       
    74     {
       
    75     return iMap->Count();
       
    76     }
       
    77 
       
    78 
       
    79 // ---------------------------------------------------------------------------
       
    80 // CAppInfoMap::InsertL
       
    81 // ---------------------------------------------------------------------------
       
    82     
       
    83 void CAppInfoMap::InsertL(const TDesC8& /*aKey*/, const TLiwVariant& /*aValue*/)
       
    84     {
       
    85         // Not Supported Right now.
       
    86         User::Leave( KErrNotSupported );
       
    87     }
       
    88     
       
    89     
       
    90 // ---------------------------------------------------------------------------
       
    91 // CAppInfoMap::Remove
       
    92 // ---------------------------------------------------------------------------
       
    93     
       
    94 void CAppInfoMap::Remove(const TDesC8& /* aKey */)
       
    95     {
       
    96         // Not Supported Right now.
       
    97     }    
       
    98     
       
    99     
       
   100 // ---------------------------------------------------------------------------
       
   101 // CAppInfoMap::Remove
       
   102 // ---------------------------------------------------------------------------
       
   103     
       
   104 TBool CAppInfoMap::operator==(const CLiwMap& /* aMap */) const
       
   105     {
       
   106 
       
   107         // Not Supported Right now.
       
   108         return ETrue ; 
       
   109     }    
       
   110     
       
   111 
       
   112     
       
   113 // ---------------------------------------------------------------------------
       
   114 // CAppInfoMap::AtL
       
   115 // ---------------------------------------------------------------------------
       
   116     
       
   117 TBool CAppInfoMap::AtL(TInt aIndex, TDes8& aFndKey) const
       
   118     {
       
   119     return iMap->AtL( aIndex, aFndKey );
       
   120     }  
       
   121     
       
   122     
       
   123     
       
   124     
       
   125   
       
   126 // ---------------------------------------------------------------------------
       
   127 // CAppInfoMap::CAppInfoMap
       
   128 // Parameterised constructor
       
   129 // ---------------------------------------------------------------------------
       
   130 //
       
   131 
       
   132 CAppInfoMap::CAppInfoMap( MInfoMap* aMap)
       
   133             : iMap(aMap)
       
   134     {
       
   135 
       
   136     }
       
   137