menufw/hierarchynavigator/hnmetadatamodel/src/hnsimpleconditionsmaller.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 "hnsimpleconditionsmaller.h"
       
    21 
       
    22 // ======== MEMBER FUNCTIONS ========
       
    23 
       
    24 // ---------------------------------------------------------------------------
       
    25 //
       
    26 // ---------------------------------------------------------------------------
       
    27 //
       
    28 TBool CHnSimpleConditionSmaller::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::EVariantTypeTInt32 )
       
    39             {
       
    40             ret = (aVarLeft.AsTInt32() < aVarRight.AsTInt32());
       
    41             }
       
    42         else if( varLId == LIW::EVariantTypeTInt64 )
       
    43             {
       
    44             ret = (aVarLeft.AsTInt64() < aVarRight.AsTInt64());
       
    45             }
       
    46         else if( varLId == LIW::EVariantTypeTUint )
       
    47             {
       
    48             ret = (aVarLeft.AsTUint() < aVarRight.AsTUint() );
       
    49             }
       
    50         else if( varLId == LIW::EVariantTypeDesC )
       
    51             {
       
    52             ret = ( aVarLeft.AsDes().Compare( aVarRight.AsDes()) < 0 );
       
    53             }
       
    54         }
       
    55     return ret;
       
    56     }
       
    57 
       
    58 // ---------------------------------------------------------------------------
       
    59 //
       
    60 // ---------------------------------------------------------------------------
       
    61 //
       
    62 TInt CHnSimpleConditionSmaller::GetPositionL( const TDesC8& aBuffer )
       
    63     {
       
    64     return aBuffer.Find( HnLogicalRelations::KLogicalLess8 );
       
    65     }
       
    66 
       
    67 // ---------------------------------------------------------------------------
       
    68 //
       
    69 // ---------------------------------------------------------------------------
       
    70 //   
       
    71 TInt CHnSimpleConditionSmaller::SignLength()
       
    72     {
       
    73      return HnLogicalRelations::KLogicalLess8().Length();
       
    74     }
       
    75