First public contribution.
     1 // Copyright (c) 2004-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
 
    19 #include "D32Assert.h"
 
    21 #include "cn_cmdparse.h"
 
    26 It will be used for parsed command line arguments.
 
    29 static TCmdLinePrm TheCmdLinePrm;
 
    32 DoMainL() parses the command line, fills TheCmdLinePrm struct, creates the appropriate
 
    33 command line execution object and calls its RunL() method.
 
    39 	__LEAVE_IF_ERROR(fileSession.Connect());
 
    40 	CleanupClosePushL(fileSession);
 
    42 	CCommandLineArguments* cmdLineParser = CCommandLineArguments::NewLC();
 
    44 	TSPConvUtil::ParseL(*cmdLineParser, TheCmdLinePrm);
 
    45 	TSPConvUtil::ConstructBinFileNameL(TheCmdLinePrm.iBinFile);
 
    47 	CCmdProcessor* proc = TCmdProcessorFactory::NewLC(fileSession, TheCmdLinePrm);
 
    50 	CleanupStack::PopAndDestroy(3, &fileSession);//cmdLineParser, fileSession, proc
 
    54 The main function of DbSpConv tool, which can be used to load and parse a text policy file
 
    55 and store it in a binary policy file, which can be used by the DBMS server.
 
    61 	CTrapCleanup* trapCleanup = CTrapCleanup::New();
 
    62 	__ASSERT_ALWAYS(trapCleanup != NULL, User::Invariant());
 
    64 	TRAPD(err, ::DoMainL());
 
    68 		_LIT(KText, "Security policy tool failed. Error code = %d\n");
 
    69 		TSPConvUtil::Print(KText, err);
 
    73 		_LIT(KText, "\"%S\"->\"%S\" : OK!\n");
 
    74 		TSPConvUtil::Print(KText, TheCmdLinePrm.iTxtFile, TheCmdLinePrm.iBinFile);