ncdengine/provider/server/src/ncdnodeidentifierutils.cpp
changeset 0 ba25891c3a9e
equal deleted inserted replaced
-1:000000000000 0:ba25891c3a9e
       
     1 /*
       
     2 * Copyright (c) 2006 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:  
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #include "ncdnodeidentifierutils.h"
       
    20 #include "ncdnodeidentifier.h"
       
    21 
       
    22 
       
    23 TBool NcdNodeIdentifierUtils::ContainsIdentifier(
       
    24     const CNcdNodeIdentifier& aIdentifier,
       
    25     const RPointerArray<CNcdNodeIdentifier>& aArray )
       
    26     {
       
    27     TInt count = aArray.Count();
       
    28     for ( TInt i = 0; i < count; i++ ) 
       
    29         {
       
    30         if ( aArray[ i ]->Equals( aIdentifier ) ) 
       
    31             {
       
    32             return ETrue;
       
    33             }
       
    34         }
       
    35     return EFalse;
       
    36     }
       
    37     
       
    38 TInt NcdNodeIdentifierUtils::IdentifierIndex(
       
    39     const CNcdNodeIdentifier& aIdentifier,
       
    40     const RPointerArray<CNcdNodeIdentifier>& aArray )
       
    41     {
       
    42     TInt count = aArray.Count();
       
    43     for ( TInt i = 0; i < count; i++ ) 
       
    44         {
       
    45         if ( aArray[ i ]->Equals( aIdentifier ) ) 
       
    46             {
       
    47             return i;
       
    48             }
       
    49         }
       
    50     return KErrNotFound;
       
    51     }