diff -r 000000000000 -r bde4ae8d615e os/ossrv/lowlevellibsandfws/pluginfw/Framework/EcomTestUtils/t_processrloaderdeletefile.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/os/ossrv/lowlevellibsandfws/pluginfw/Framework/EcomTestUtils/t_processrloaderdeletefile.cpp Fri Jun 15 03:10:57 2012 +0200 @@ -0,0 +1,59 @@ +// 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: +// Hepler process with high capability to perform deletion of files for +// test harnesses. +// +// + +#include +#include +#include + + +void DeleteFileL(const TDesC& aFile) + { + TInt r = KErrNone; + RLoader rloader; + r = rloader.Connect(); + if (r != KErrNone) + { + User::Leave(r); + } + CleanupClosePushL(rloader); + + TInt err = rloader.Delete(aFile); + if ((err != KErrNone) && (err != KErrPathNotFound)) + User::Leave(err); + + CleanupStack::PopAndDestroy(1); + rloader.Close(); + } + +GLDEF_C TInt E32Main() + { + CTrapCleanup* cleanup = CTrapCleanup::New(); + + TFileName name; + User::CommandLine(name); + + TInt err = KErrNone; + TRAP(err,DeleteFileL(name)); + if (err == KErrNone) + RDebug::Print(_L("RLoader Delete file '%S' succeeded.\n"), &name); + else + RDebug::Print(_L("RLoader Delete file '%S' failed with error = %d.\n"), &name, err); + + delete cleanup; + return err; + }