sl@0: /* sl@0: * Copyright (c) 1998-2009 Nokia Corporation and/or its subsidiary(-ies). sl@0: * All rights reserved. sl@0: * This component and the accompanying materials are made available sl@0: * under the terms of the License "Eclipse Public License v1.0" sl@0: * which accompanies this distribution, and is available sl@0: * at the URL "http://www.eclipse.org/legal/epl-v10.html". sl@0: * sl@0: * Initial Contributors: sl@0: * Nokia Corporation - initial contribution. sl@0: * sl@0: * Contributors: sl@0: * sl@0: * Description: sl@0: * sl@0: */ sl@0: sl@0: sl@0: #include "ttesthandlersettings.h" sl@0: #include "t_bacline.h" sl@0: sl@0: _LIT(KWaitForKeyPressAtEndSwitch, "-w"); sl@0: _LIT(KOOMSwitch, "-o"); sl@0: _LIT(KInteractiveSwitch, "-i"); sl@0: _LIT(KCancelSwitch, "-c"); sl@0: _LIT(KSkippedSwitch, "-s"); sl@0: _LIT(KExhaustiveSwitch, "-e"); sl@0: sl@0: EXPORT_C CTestHandlerSettings* CTestHandlerSettings::NewLC() sl@0: { sl@0: CTestHandlerSettings* self = new(ELeave) CTestHandlerSettings(); sl@0: CleanupStack::PushL(self); sl@0: self->ConstructL(); sl@0: return self; sl@0: } sl@0: sl@0: EXPORT_C CTestHandlerSettings* CTestHandlerSettings::NewL(const CTestHandlerSettings& aOther) sl@0: { sl@0: CTestHandlerSettings* self = new(ELeave) CTestHandlerSettings(); sl@0: self->iWaitForKeyPressAtEnd = aOther.iWaitForKeyPressAtEnd; sl@0: self->iOOM = aOther.iOOM; sl@0: self->iCancel = aOther.iCancel; sl@0: self->iSkip = aOther.iSkip; sl@0: self->iExhaust = aOther.iExhaust; sl@0: self->iInt = aOther.iInt; sl@0: return self; sl@0: } sl@0: sl@0: EXPORT_C CTestHandlerSettings::~CTestHandlerSettings() sl@0: { sl@0: } sl@0: sl@0: CTestHandlerSettings::CTestHandlerSettings() sl@0: { sl@0: iWaitForKeyPressAtEnd = iOOM = iCancel = iSkip = iExhaust = iInt = EFalse; sl@0: } sl@0: sl@0: void CTestHandlerSettings::ConstructL() sl@0: { sl@0: CCommandLineArguments* cmdLine = CCommandLineArguments::NewL(); sl@0: sl@0: TInt argTotal=cmdLine->Count(); sl@0: sl@0: for (TInt loop=0 ; loop < argTotal ; ++loop) sl@0: { sl@0: TPtrC arg(cmdLine->Arg(loop)); sl@0: if (arg==KWaitForKeyPressAtEndSwitch) sl@0: { sl@0: iWaitForKeyPressAtEnd = ETrue; sl@0: } sl@0: else if (arg==KOOMSwitch) sl@0: { sl@0: iOOM = ETrue; sl@0: } sl@0: else if (arg==KInteractiveSwitch) sl@0: { sl@0: iInt = ETrue; sl@0: } sl@0: else if (arg==KCancelSwitch) sl@0: { sl@0: iCancel = ETrue; sl@0: } sl@0: else if (arg==KSkippedSwitch) sl@0: { sl@0: iSkip = ETrue; sl@0: } sl@0: else if (arg==KExhaustiveSwitch) sl@0: { sl@0: iExhaust = ETrue; sl@0: } sl@0: } sl@0: sl@0: delete cmdLine; sl@0: cmdLine = NULL; sl@0: }