Update contrib.
1 // Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
2 // All rights reserved.
3 // This component and the accompanying materials are made available
4 // under the terms of "Eclipse Public License v1.0"
5 // which accompanies this distribution, and is available
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
14 // E32Main(), DoMainL() implementations
20 #include "CentRepConvTool.h"
24 // DoMainL() get command line args and pass them to CCentRepConv.
30 // create and install the active scheduler so that
31 // CacheManager can add itself to the scheduler.
32 // *** but do not CActiveScheduler::Start() ***
33 CActiveScheduler* s=new(ELeave) CActiveScheduler;
34 CleanupStack::PushL(s);
36 CActiveScheduler::Install(s);
38 TServerResources::InitialiseL(); // CentRep server static data
39 CleanupStack::PushL(TCleanupItem(TCleanupOperation(&TServerResources::Close), NULL));
42 HBufC* cmdLine = HBufC::NewL(User::CommandLineLength());
43 CleanupStack::PushL(cmdLine);
46 TPtr cmdLinePtr(cmdLine->Des());
47 User::CommandLine(cmdLinePtr);
49 CCentRepConvTool* convTool = CCentRepConvTool::NewL(*cmdLine,
50 TServerResources::iFs, ETrue);
51 CleanupStack::PushL(convTool);
54 convTool->ProcessCmdL();
56 CleanupStack::PopAndDestroy(nPushed);
60 // The main function of CentRepConv tool which converts repository files
61 // from text format to binary and vice versa.
62 // Repositories in binary format load faster. CentRep clients are
63 // strongly encouraged to convert their text init files to binary
64 // to speed up access to their settings.
70 CTrapCleanup* trapCleanup = CTrapCleanup::New();
71 __ASSERT_ALWAYS(trapCleanup != NULL, User::Invariant());
73 TRAPD(err, ::DoMainL());
77 _LIT(KText, "CentRepConv tool failed. Error code = %d");
78 RDebug::Print(KText, err);