logsui/logsengine/logssymbianos/tsrc/stubs/centralrepository_stub.cpp
changeset 17 90fe74753f71
parent 15 76d2cf7a585e
child 18 acd4e87b24b4
equal deleted inserted replaced
15:76d2cf7a585e 17:90fe74753f71
     1 /*
       
     2 * Copyright (c) 2005 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 <centralrepository.h>
       
    20 #include "centralrepository_stub_helper.h"
       
    21 
       
    22 TInt mFailCode = KErrNone;
       
    23 TInt mCurrentVal = 0;
       
    24 
       
    25 void CentralRepositoryStubHelper::reset()
       
    26 {
       
    27     mFailCode = KErrNone;
       
    28     mCurrentVal = 0;
       
    29 }
       
    30 
       
    31 void CentralRepositoryStubHelper::setFailCode(TInt err)
       
    32 {
       
    33     mFailCode = err;
       
    34 }
       
    35 void CentralRepositoryStubHelper::setCurrentVal(TInt val)
       
    36 {
       
    37     mCurrentVal = val;
       
    38 } 
       
    39 TInt CentralRepositoryStubHelper::currentVal()
       
    40 {
       
    41     return mCurrentVal;
       
    42 }  
       
    43     
       
    44 // -----------------------------------------------------------------------------
       
    45 //
       
    46 // -----------------------------------------------------------------------------
       
    47 //
       
    48 EXPORT_C CRepository* CRepository::NewL( TUid aRepositoryUid )
       
    49     {
       
    50     CRepository* self = CRepository::NewLC( aRepositoryUid );
       
    51     CleanupStack::Pop( self );
       
    52     return self;
       
    53     }
       
    54     
       
    55     
       
    56 // -----------------------------------------------------------------------------
       
    57 //
       
    58 // -----------------------------------------------------------------------------
       
    59 // 
       
    60 CRepository* CRepository::NewLC( TUid /*aRepositoryUid*/ )
       
    61     {
       
    62     CRepository* self = new (ELeave) CRepository();
       
    63     CleanupStack::PushL( self );
       
    64     return self;
       
    65     }
       
    66 
       
    67 
       
    68 // -----------------------------------------------------------------------------
       
    69 //
       
    70 // -----------------------------------------------------------------------------
       
    71 //
       
    72 CRepository::~CRepository()
       
    73     {
       
    74     }
       
    75 
       
    76 // -----------------------------------------------------------------------------
       
    77 //
       
    78 // -----------------------------------------------------------------------------
       
    79 //
       
    80 TInt CRepository::Get(TUint32 /*aKey*/, TInt& aValue)
       
    81     {
       
    82     aValue = mCurrentVal;
       
    83     return mFailCode;
       
    84     }
       
    85 
       
    86 
       
    87 // -----------------------------------------------------------------------------
       
    88 //
       
    89 // -----------------------------------------------------------------------------
       
    90 //
       
    91 TInt CRepository::Set(TUint32 /*aKey*/, TInt aValue)
       
    92     {
       
    93     if ( mFailCode == KErrNone )
       
    94         {
       
    95         mCurrentVal = aValue;
       
    96         }
       
    97     return mFailCode;
       
    98     }
       
    99 
       
   100