menufw/hierarchynavigator/hnmetadatamodel/src/hnsimpleconditionhas.cpp
changeset 0 f72a12da539e
equal deleted inserted replaced
-1:000000000000 0:f72a12da539e
       
     1 /*
       
     2 * Copyright (c) 2007-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: 
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #include "hnsimplecondition.h"
       
    20 #include "hnsimpleconditionhas.h"
       
    21 
       
    22 // ======== MEMBER FUNCTIONS ========
       
    23 
       
    24 // ---------------------------------------------------------------------------
       
    25 //
       
    26 // ---------------------------------------------------------------------------
       
    27 //
       
    28 TBool CHnSimpleConditionHas::CheckCondition( TLiwVariant& aVarLeft, 
       
    29         TLiwVariant& aVarRight )
       
    30     {
       
    31     TBool ret = EFalse;
       
    32     
       
    33     LIW::TVariantTypeId varLId = aVarLeft.TypeId();
       
    34     LIW::TVariantTypeId varRId = aVarRight.TypeId();
       
    35     
       
    36     if (varLId == varRId)
       
    37         {
       
    38         if( varLId == LIW::EVariantTypeDesC )
       
    39             {
       
    40             TPtrC left  = aVarLeft.AsDes();
       
    41             TPtrC right = aVarRight.AsDes();
       
    42             
       
    43             if ( KErrNotFound != left.Find( right ) )
       
    44                 {
       
    45                 ret = ETrue;
       
    46                 }
       
    47             }
       
    48         }
       
    49     return ret;
       
    50     }
       
    51 
       
    52 // ---------------------------------------------------------------------------
       
    53 //
       
    54 // ---------------------------------------------------------------------------
       
    55 //
       
    56 TInt CHnSimpleConditionHas::GetPositionL( const TDesC8& aBuffer )
       
    57     {
       
    58     return aBuffer.Find( HnLogicalRelations::KLogicalHas8 );
       
    59     }
       
    60 
       
    61 // ---------------------------------------------------------------------------
       
    62 //
       
    63 // ---------------------------------------------------------------------------
       
    64 //   
       
    65 TInt CHnSimpleConditionHas::SignLength()
       
    66     {
       
    67      return HnLogicalRelations::KLogicalHas8().Length();
       
    68     }