menufw/hierarchynavigator/hnmetadatamodel/src/hnsimpleconditionhasnot.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 "hnsimpleconditionhasnot.h"
       
    21 
       
    22 // ---------------------------------------------------------------------------
       
    23 //
       
    24 // ---------------------------------------------------------------------------
       
    25 //
       
    26 TBool CHnSimpleConditionHasNot::CheckCondition( TLiwVariant& aVarLeft, 
       
    27         TLiwVariant& aVarRight )
       
    28     {
       
    29     TBool ret = EFalse;
       
    30     
       
    31     LIW::TVariantTypeId varLId = aVarLeft.TypeId();
       
    32     LIW::TVariantTypeId varRId = aVarRight.TypeId();
       
    33     
       
    34     if (varLId == varRId)
       
    35         {
       
    36         if( varLId == LIW::EVariantTypeDesC )
       
    37             {
       
    38             TPtrC left  = aVarLeft.AsDes();
       
    39             TPtrC right = aVarRight.AsDes();
       
    40             
       
    41             if ( KErrNotFound != left.Find( right ) )
       
    42                 {
       
    43                 ret = ETrue;
       
    44                 }
       
    45             }
       
    46         }
       
    47     return !ret;
       
    48     }
       
    49 
       
    50 // ---------------------------------------------------------------------------
       
    51 //
       
    52 // ---------------------------------------------------------------------------
       
    53 //
       
    54 TInt CHnSimpleConditionHasNot::GetPositionL( const TDesC8& aBuffer )
       
    55     {
       
    56     return aBuffer.Find( HnLogicalRelations::KLogicalHasNot8 );
       
    57     }
       
    58 
       
    59 // ---------------------------------------------------------------------------
       
    60 //
       
    61 // ---------------------------------------------------------------------------
       
    62 //   
       
    63 TInt CHnSimpleConditionHasNot::SignLength()
       
    64     {
       
    65      return HnLogicalRelations::KLogicalHasNot8().Length();
       
    66     }
       
    67