diff -r 000000000000 -r d0791faffa3f mtpfws/mtpfw/dataproviders/proxydp/src/cmtpproxydpconfigmgr.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mtpfws/mtpfw/dataproviders/proxydp/src/cmtpproxydpconfigmgr.cpp Tue Feb 02 01:11:40 2010 +0200 @@ -0,0 +1,108 @@ +// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies). +// All rights reserved. +// This component and the accompanying materials are made available +// under the terms of "Eclipse Public License v1.0" +// which accompanies this distribution, and is available +// at the URL "http://www.eclipse.org/legal/epl-v10.html". +// +// Initial Contributors: +// Nokia Corporation - initial contribution. +// +// Contributors: +// +// Description: +// + + + + +#include "cmtpproxydpconfigmgr.h" +#include +#include +#include +#include +__FLOG_STMT(_LIT8(KComponent1,"ProxyDPConfigmanager");) + +CMTPProxyDpConfigMgr* CMTPProxyDpConfigMgr::NewL(MMTPDataProviderFramework& aFramework) + { + CMTPProxyDpConfigMgr* self = new (ELeave) CMTPProxyDpConfigMgr(aFramework); + CleanupStack::PushL(self); + self->ConstructL(); + CleanupStack::Pop(self); + return self; + } + +CMTPProxyDpConfigMgr::CMTPProxyDpConfigMgr(MMTPDataProviderFramework& aFramework) : + iFramework(aFramework) + { + } + +void CMTPProxyDpConfigMgr::ConstructL() + { + __FLOG_OPEN(KMTPSubsystem, KComponent1); + TUint32 resourceId = iFramework.DataProviderConfig().UintValue(MMTPDataProviderConfig::EOpaqueResource); + // Reading from resource file mtpproxydp_config.rss + RResourceFile resourceFile; + CleanupClosePushL(resourceFile); + resourceFile.OpenL(iFramework.Fs(), iFramework.DataProviderConfig().DesCValue(MMTPDataProviderConfig::EResourceFileName)); + TResourceReader resourceReader; + HBufC8* buffer = resourceFile.AllocReadLC(resourceId); + resourceReader.SetBuffer(buffer); + FileMappingStruct st; + const TInt numberOfEntries=resourceReader.ReadInt16(); + for(TInt count =0;countFind(aFileName,aIndex); + if(err == KErrNone) + { + aIndex=i; + __FLOG_1( _L8("aIndex = %d"), aIndex ); + __FLOG(_L8("GetFileName - Exit")); + return ETrue; + } + } + + __FLOG(_L8("GetFileName - Exit")); + return EFalse; + } + +TUint CMTPProxyDpConfigMgr::GetDPId(const TInt& aIndex) + { + return iMappingStruct[aIndex].iDpUid; + }