First public contribution.
2 * Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
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".
9 * Initial Contributors:
10 * Nokia Corporation - initial contribution.
18 #include "T_RHandleBaseData.h"
21 _LIT(KCmdClose, "Close");
22 _LIT(KCmdFullName, "FullName");
23 _LIT(KCmdName, "Name");
25 _LIT(KFldExpected, "expected");
26 _LIT(KFldNameParameter, "nameParameter");
28 _LIT(KLogErrorExpectedValue, "Expected Value does not match actual");
31 //////////////////////////////////////////////////////////////////////
32 // Construction/Destruction
33 //////////////////////////////////////////////////////////////////////
35 CT_RHandleBaseData::CT_RHandleBaseData()
40 CT_RHandleBaseData::~CT_RHandleBaseData()
47 TBool CT_RHandleBaseData::DoCommandL(const TTEFFunction& aCommand, const TTEFSectionName& aSection, const TInt aAsyncErrorIndex)
49 * Process a command read from the ini file
51 * @param aCommand The command to process
52 * @param aSection The section in the ini containing data for the command
53 * @param aAsyncErrorIndex Command index for async calls to return errors to
55 * @return ETrue if the command is processed
57 * @leave System wide error
62 if ( aCommand==KCmdClose )
66 else if ( aCommand==KCmdFullName )
68 DoCmdFullName(aSection);
70 else if ( aCommand==KCmdName )
76 ret=CDataWrapperBase::DoCommandL(aCommand, aSection, aAsyncErrorIndex);
82 void CT_RHandleBaseData::DoCmdClose()
84 GetHandleBase()->Close();
87 void CT_RHandleBaseData::DoCmdFullName(const TDesC& aSection)
91 TBool nameParameter=ETrue;
92 GetBoolFromConfig(aSection, KFldNameParameter(), nameParameter);
96 GetHandleBase()->FullName(actual);
100 actual=GetHandleBase()->FullName();
102 INFO_PRINTF2(_L("FullName: (%S)" ), &actual);
105 if ( GetStringFromConfig(aSection, KFldExpected, expected) )
107 if ( expected!=actual )
109 ERR_PRINTF1(KLogErrorExpectedValue);
110 SetBlockResult(EFail);
115 void CT_RHandleBaseData::DoCmdName(const TDesC& aSection)
117 TName actual=GetHandleBase()->Name();
118 INFO_PRINTF2(_L("Name: (%S)" ), &actual);
121 if ( GetStringFromConfig(aSection, KFldExpected, expected) )
123 if ( expected!=actual )
125 ERR_PRINTF1(KLogErrorExpectedValue);
126 SetBlockResult(EFail);