mtpfws/mtpfw/dataproviders/proxydp/src/cmtpproxydpconfigmgr.cpp
changeset 47 63cf70d3ecd8
parent 0 d0791faffa3f
equal deleted inserted replaced
44:a5deb6b96675 47:63cf70d3ecd8
    19 #include "cmtpproxydpconfigmgr.h"
    19 #include "cmtpproxydpconfigmgr.h"
    20 #include <barsc.h>
    20 #include <barsc.h>
    21 #include <barsread.h>
    21 #include <barsread.h>
    22 #include <mtp/mmtpdataproviderconfig.h>
    22 #include <mtp/mmtpdataproviderconfig.h>
    23 #include <mtp/mmtpdataproviderframework.h>
    23 #include <mtp/mmtpdataproviderframework.h>
    24 __FLOG_STMT(_LIT8(KComponent1,"ProxyDPConfigmanager");)
    24 #include "OstTraceDefinitions.h"
       
    25 #ifdef OST_TRACE_COMPILER_IN_USE
       
    26 #include "cmtpproxydpconfigmgrTraces.h"
       
    27 #endif
       
    28 
    25 
    29 
    26 CMTPProxyDpConfigMgr* CMTPProxyDpConfigMgr::NewL(MMTPDataProviderFramework& aFramework)
    30 CMTPProxyDpConfigMgr* CMTPProxyDpConfigMgr::NewL(MMTPDataProviderFramework& aFramework)
    27 	{
    31 	{
    28 	CMTPProxyDpConfigMgr* self = new (ELeave) CMTPProxyDpConfigMgr(aFramework);
    32 	CMTPProxyDpConfigMgr* self = new (ELeave) CMTPProxyDpConfigMgr(aFramework);
    29 	CleanupStack::PushL(self);
    33 	CleanupStack::PushL(self);
    37 	{
    41 	{
    38 	}
    42 	}
    39 	
    43 	
    40 void CMTPProxyDpConfigMgr::ConstructL()
    44 void CMTPProxyDpConfigMgr::ConstructL()
    41 	{
    45 	{
    42 	__FLOG_OPEN(KMTPSubsystem, KComponent1);
    46 	OstTraceFunctionEntry0( CMTPPROXYDPCONFIGMGR_CONSTRUCTL_ENTRY );
    43 	TUint32 resourceId = iFramework.DataProviderConfig().UintValue(MMTPDataProviderConfig::EOpaqueResource);
    47 	TUint32 resourceId = iFramework.DataProviderConfig().UintValue(MMTPDataProviderConfig::EOpaqueResource);
    44 	// Reading from resource file mtpproxydp_config.rss 
    48 	// Reading from resource file mtpproxydp_config.rss 
    45 	RResourceFile resourceFile;
    49 	RResourceFile resourceFile;
    46 	CleanupClosePushL(resourceFile);
    50 	CleanupClosePushL(resourceFile);
    47 	resourceFile.OpenL(iFramework.Fs(), iFramework.DataProviderConfig().DesCValue(MMTPDataProviderConfig::EResourceFileName));
    51 	resourceFile.OpenL(iFramework.Fs(), iFramework.DataProviderConfig().DesCValue(MMTPDataProviderConfig::EResourceFileName));
    57 		InsertToMappingStruct(st);	
    61 		InsertToMappingStruct(st);	
    58 		}	
    62 		}	
    59 		
    63 		
    60 	CleanupStack::PopAndDestroy(2, &resourceFile);
    64 	CleanupStack::PopAndDestroy(2, &resourceFile);
    61 	
    65 	
       
    66 	OstTraceFunctionExit0( CMTPPROXYDPCONFIGMGR_CONSTRUCTL_EXIT );
    62 	}
    67 	}
    63 	
    68 	
    64 CMTPProxyDpConfigMgr::~CMTPProxyDpConfigMgr()
    69 CMTPProxyDpConfigMgr::~CMTPProxyDpConfigMgr()
    65 	{
    70 	{
       
    71 	OstTraceFunctionEntry0( CMTPPROXYDPCONFIGMGR_CMTPPROXYDPCONFIGMGR_DES_ENTRY );
    66 	TInt count = iMappingStruct.Count();
    72 	TInt count = iMappingStruct.Count();
    67 	for(TInt i=0 ; i<count ; i++)
    73 	for(TInt i=0 ; i<count ; i++)
    68 		{
    74 		{
    69 		delete iMappingStruct[i].iFileArray;
    75 		delete iMappingStruct[i].iFileArray;
    70 		}
    76 		}
    71 	iMappingStruct.Reset();
    77 	iMappingStruct.Reset();
    72 	iMappingStruct.Close(); 
    78 	iMappingStruct.Close(); 
    73 	__FLOG_CLOSE;
    79 	OstTraceFunctionExit0( CMTPPROXYDPCONFIGMGR_CMTPPROXYDPCONFIGMGR_DES_EXIT );
    74 	}
    80 	}
    75 	
    81 	
    76 void CMTPProxyDpConfigMgr::InsertToMappingStruct(FileMappingStruct& aRef)
    82 void CMTPProxyDpConfigMgr::InsertToMappingStruct(FileMappingStruct& aRef)
    77 	{
    83 	{
    78 	iMappingStruct.Append(aRef);
    84 	iMappingStruct.Append(aRef);
    79 	}
    85 	}
    80 	
    86 	
    81 TBool CMTPProxyDpConfigMgr::GetFileName(const TDesC& aFileName,TInt& aIndex)
    87 TBool CMTPProxyDpConfigMgr::GetFileName(const TDesC& aFileName,TInt& aIndex)
    82 	{
    88 	{
    83     __FLOG(_L8("GetFileName - Entry"));
    89     OstTraceFunctionEntry0( CMTPPROXYDPCONFIGMGR_GETFILENAME_ENTRY );
    84     
    90     OstTraceExt1( TRACE_NORMAL, CMTPPROXYDPCONFIGMGR_GETFILENAME, "aFileName = %S",  aFileName);
    85     __FLOG_1( _L8("aFileName = %s"), &aFileName );
    91         
    86     
       
    87 	TInt count = iMappingStruct.Count();
    92 	TInt count = iMappingStruct.Count();
    88     __FLOG_1( _L8("count = %d"), count );
    93     OstTrace1( TRACE_NORMAL, DUP1_CMTPPROXYDPCONFIGMGR_GETFILENAME, "count = %d", count );    
    89 	for(TInt i=0 ; i<count ; i++)
    94 	for(TInt i=0 ; i<count ; i++)
    90 		{
    95 		{
    91 		TInt err=iMappingStruct[i].iFileArray->Find(aFileName,aIndex);
    96 		TInt err=iMappingStruct[i].iFileArray->Find(aFileName,aIndex);
    92 		if(err == KErrNone)
    97 		if(err == KErrNone)
    93 			{
    98 			{
    94 			aIndex=i;
    99 			aIndex=i;
    95 		    __FLOG_1( _L8("aIndex = %d"), aIndex );
   100 		    OstTrace1( TRACE_NORMAL, DUP2_CMTPPROXYDPCONFIGMGR_GETFILENAME, "aIndex = %d", aIndex );    
    96 		    __FLOG(_L8("GetFileName - Exit"));
   101 			OstTraceFunctionExit0( CMTPPROXYDPCONFIGMGR_GETFILENAME_EXIT );
    97 			return ETrue;			
   102 			return ETrue;			
    98 			}
   103 			}
    99 		}
   104 		}
   100 	
   105 	
   101     __FLOG(_L8("GetFileName - Exit"));
   106 	OstTraceFunctionExit0( DUP1_CMTPPROXYDPCONFIGMGR_GETFILENAME_EXIT );
   102 	return EFalse;
   107 	return EFalse;
   103 	}
   108 	}
   104 	
   109 	
   105 TUint CMTPProxyDpConfigMgr::GetDPId(const TInt& aIndex)
   110 TUint CMTPProxyDpConfigMgr::GetDPId(const TInt& aIndex)
   106 	{
   111 	{