natfw/natfwclient/tsrc/ut_natfwclient/src/settings.cpp
changeset 0 1bce908db942
equal deleted inserted replaced
-1:000000000000 0:1bce908db942
       
     1 /*
       
     2 * Copyright (c) 2007 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 
       
    20 #include "settings.h"
       
    21 
       
    22 #include <centralrepository.h>
       
    23 
       
    24 #include "datadepository.h"
       
    25 
       
    26 // -----------------------------------------------------------------------------
       
    27 // CSettings
       
    28 // -----------------------------------------------------------------------------
       
    29 // 
       
    30 CSettings::CSettings()
       
    31     {
       
    32     }
       
    33  
       
    34  
       
    35 // -----------------------------------------------------------------------------
       
    36 // ~CSettings
       
    37 // -----------------------------------------------------------------------------
       
    38 //
       
    39 CSettings::~CSettings( )
       
    40     {
       
    41     delete iDepository;
       
    42     delete iRepository;
       
    43     }
       
    44 
       
    45 // -----------------------------------------------------------------------------
       
    46 // CSettings::ConstructBaseL
       
    47 // -----------------------------------------------------------------------------
       
    48 //  
       
    49 void CSettings::ConstructBaseL( TUid aCRUid )
       
    50     {
       
    51     iRepository = CRepository::NewL( aCRUid );
       
    52     iDepository = CDataDepository::NewL( iRepository );
       
    53     }
       
    54 
       
    55 
       
    56 // -----------------------------------------------------------------------------
       
    57 // CSettings::CreateNewTableKeyL
       
    58 // -----------------------------------------------------------------------------
       
    59 //
       
    60 EXPORT_C TUint32 CSettings::CreateNewTableKeyL( TUint aTableMask, TUint32 aFieldMask ) const
       
    61     {
       
    62     return iDepository->CreateNewTableKeyL( aTableMask, aFieldMask );
       
    63     }
       
    64 
       
    65 
       
    66 // -----------------------------------------------------------------------------
       
    67 // CSettings::StoreL
       
    68 // -----------------------------------------------------------------------------
       
    69 //
       
    70 EXPORT_C void CSettings::StoreL( const TUint32 aKey, const TInt aData )
       
    71     {
       
    72     iDepository->StoreL( aKey, aData );
       
    73     }
       
    74 
       
    75 
       
    76 // -----------------------------------------------------------------------------
       
    77 // CSettings::StoreL
       
    78 // -----------------------------------------------------------------------------
       
    79 //
       
    80 EXPORT_C void CSettings::StoreL( const TUint32 aKey, const TDesC8& aData )
       
    81     {
       
    82     iDepository->StoreL( aKey, aData );
       
    83     }
       
    84     
       
    85     
       
    86 // -----------------------------------------------------------------------------
       
    87 // CSettings::Read(
       
    88 // -----------------------------------------------------------------------------
       
    89 //
       
    90 EXPORT_C TInt CSettings::Read( const TUint32 aKey, TInt& aData )
       
    91     {
       
    92     return iDepository->Read( aKey, aData );
       
    93     }
       
    94 
       
    95 
       
    96 // -----------------------------------------------------------------------------
       
    97 // CSettings::ReadL
       
    98 // -----------------------------------------------------------------------------
       
    99 //
       
   100 EXPORT_C TInt CSettings::ReadL( const TUint32 aKey, HBufC8** aData )
       
   101     {
       
   102     return iDepository->ReadL( aKey, aData );
       
   103     }
       
   104     
       
   105     
       
   106 // -----------------------------------------------------------------------------
       
   107 // CSettings::EraseL
       
   108 // -----------------------------------------------------------------------------
       
   109 //
       
   110 EXPORT_C TInt CSettings::EraseL( TUint32 aTableMask, TUint32 aFieldTypeMask )
       
   111     {
       
   112     return iDepository->EraseL( aTableMask, aFieldTypeMask );
       
   113     }
       
   114