os/persistentdata/traceservices/tracefw/ulogger/unit_test/te-createconfig/te_clearconfig.cpp
changeset 0 bde4ae8d615e
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/os/persistentdata/traceservices/tracefw/ulogger/unit_test/te-createconfig/te_clearconfig.cpp	Fri Jun 15 03:10:57 2012 +0200
     1.3 @@ -0,0 +1,92 @@
     1.4 +// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
     1.5 +// All rights reserved.
     1.6 +// This component and the accompanying materials are made available
     1.7 +// under the terms of "Eclipse Public License v1.0"
     1.8 +// which accompanies this distribution, and is available
     1.9 +// at the URL "http://www.eclipse.org/legal/epl-v10.html".
    1.10 +//
    1.11 +// Initial Contributors:
    1.12 +// Nokia Corporation - initial contribution.
    1.13 +//
    1.14 +// Contributors:
    1.15 +//
    1.16 +// Description:
    1.17 +//
    1.18 +
    1.19 +/**
    1.20 + @file te_clearconfig.cpp
    1.21 + @internalTechnology
    1.22 +*/
    1.23 +
    1.24 +#include <e32cons.h>
    1.25 +#include <e32def.h>
    1.26 +#include "te_clearconfig.h"
    1.27 +
    1.28 +CClearConfig::~CClearConfig()
    1.29 +{
    1.30 +	
    1.31 +	/*Destructor*/
    1.32 +}
    1.33 +
    1.34 +CClearConfig::CClearConfig()
    1.35 +{
    1.36 +	/*Constructor*/
    1.37 +
    1.38 +
    1.39 +}
    1.40 +
    1.41 +void CClearConfig::ClearL(RULogger& loggerSession)
    1.42 +	{	
    1.43 +//	CArrayPtrFlat<HBufC8> *activeplugins = new (ELeave)CArrayPtrFlat<HBufC8>(1);				
    1.44 +//	CleanupStack::PushL(activeplugins);
    1.45 +//	loggerSession.GetActiveOutputPlugin(*activeplugins);
    1.46 +//	if (activeplugins->Count())
    1.47 +//	{
    1.48 +//		TBuf<100> dataBuf;
    1.49 +//		dataBuf.Copy(activeplugins->At(1)->Des());
    1.50 +//		loggerSession.DeActivateOutputPlugin(dataBuf);
    1.51 +//	}
    1.52 +//	activeplugins->ResetAndDestroy();
    1.53 +//	CleanupStack::PopAndDestroy();//ptrArray	
    1.54 +//
    1.55 +//	CArrayFixFlat<TUint8> *getfilter = new (ELeave)CArrayFixFlat<TUint8>(1);
    1.56 +//	loggerSession.GetPrimaryFilters(*getfilter);
    1.57 +//	
    1.58 +//	
    1.59 +//	TInt Result=loggerSession.RemovePrimaryFilter(*getfilter);
    1.60 +//	
    1.61 +////	CleanupStack::PopAndDestroy();//ptrArray	
    1.62 +//	RArray<TUint32> get2filter;	
    1.63 +//	loggerSession.GetSecondaryFilters(get2filter);
    1.64 +//				
    1.65 +//	
    1.66 +//	loggerSession.RemoveSecondaryFilter(get2filter);
    1.67 +//	get2filter.Close();
    1.68 +//	
    1.69 +//	loggerSession.SetBufferMode(1);
    1.70 +//	loggerSession.ResizeTraceBufferSize(65000);
    1.71 +//
    1.72 +//	loggerSession.SetDataNotificationSize(2);	
    1.73 +
    1.74 +	//disable all primary filters
    1.75 +	CArrayFixFlat<TUint8>* enabledPrimaryFilters = new (ELeave)CArrayFixFlat<TUint8>(1);
    1.76 +	CleanupStack::PushL(enabledPrimaryFilters);
    1.77 +	loggerSession.GetPrimaryFiltersEnabled(*enabledPrimaryFilters);
    1.78 +	loggerSession.SetPrimaryFiltersEnabled(*enabledPrimaryFilters, false);
    1.79 +	CleanupStack::PopAndDestroy(enabledPrimaryFilters);
    1.80 +
    1.81 +	//disable all secondary filters
    1.82 +	RArray<TUint32> enabledSecondaryFilters;
    1.83 +	CleanupClosePushL(enabledSecondaryFilters);
    1.84 +	loggerSession.GetSecondaryFiltersEnabled(enabledSecondaryFilters);
    1.85 +	loggerSession.SetSecondaryFiltersEnabled(enabledSecondaryFilters, false);
    1.86 +	CleanupStack::PopAndDestroy(); //enabledSecondaryFilters
    1.87 +
    1.88 +	//enable filtering by secondary filter
    1.89 +	loggerSession.SetSecondaryFilteringEnabled(ETrue);
    1.90 +
    1.91 +	//set buffer mode: straight, buffer-size: 65000KB, notification size: 2KB
    1.92 +	loggerSession.SetBufferMode(1);
    1.93 +	loggerSession.SetBufferSize(65000);
    1.94 +	loggerSession.SetNotificationSize(2);
    1.95 +	}