os/graphics/windowing/windowserver/test/t_integ/src/t_inidata.cpp
author sl
Tue, 10 Jun 2014 14:32:02 +0200
changeset 1 260cb5ec6c19
permissions -rw-r--r--
Update contrib.
     1 // Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
     2 // All rights reserved.
     3 // This component and the accompanying materials are made available
     4 // under the terms of "Eclipse Public License v1.0"
     5 // which accompanies this distribution, and is available
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
     7 //
     8 // Initial Contributors:
     9 // Nokia Corporation - initial contribution.
    10 //
    11 // Contributors:
    12 //
    13 // Description:
    14 //
    15 
    16 /**
    17  @file
    18  @test
    19  @internalComponent
    20 */
    21 
    22 #include <iniparser.h>
    23 #include "t_inidata.h"
    24 #include "t_wservconsts.h"
    25 
    26 EXPORT_C HBufC* CTIniData::ReadStrL(const TPtrC& aIniParam, const TDesC& aConfigFile)
    27 	{
    28 	CIniData * iniData = CIniData::NewL(aConfigFile);
    29 	CleanupStack::PushL(iniData);
    30 	
    31 	TPtrC value;
    32 	User::LeaveIfError(iniData->FindVar(KDefaultSectionName, aIniParam, value));
    33 	HBufC* ret = value.Alloc();
    34 
    35 	CleanupStack::PopAndDestroy(iniData);
    36 	return ret;
    37 	}
    38 
    39 EXPORT_C TInt CTIniData::ReadIntL(const TPtrC& aIniParam, const TDesC& aConfigFile)
    40 	{
    41 	CIniData * iniData = CIniData::NewL(aConfigFile);
    42 	CleanupStack::PushL(iniData);
    43 	
    44 	TInt ret;
    45 	User::LeaveIfError(iniData->FindVar(KDefaultSectionName, aIniParam, ret));
    46 	CleanupStack::PopAndDestroy(iniData);
    47 	return ret;
    48 	}