secureswitools/swisistools/source/interpretsis/commandparser.cpp
changeset 60 245df5276b97
parent 25 98b66e4fb0be
child 75 2d2d25361590
equal deleted inserted replaced
53:ae54820ef82c 60:245df5276b97
     1 /*
     1 /*
     2 * Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
     2 * Copyright (c) 2006-2010 Nokia Corporation and/or its subsidiary(-ies).
     3 * All rights reserved.
     3 * All rights reserved.
     4 * This component and the accompanying materials are made available
     4 * This component and the accompanying materials are made available
     5 * under the terms of the License "Eclipse Public License v1.0"
     5 * under the terms of the License "Eclipse Public License v1.0"
     6 * which accompanies this distribution, and is available
     6 * which accompanies this distribution, and is available
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
   401 				aParamList->SetZDrive(*(++argv));
   401 				aParamList->SetZDrive(*(++argv));
   402 				break;
   402 				break;
   403 				}
   403 				}
   404 			default:
   404 			default:
   405 				{
   405 				{
   406 				LERROR(Utf8ToUcs2(std::string(optPtr)));
   406 				LERROR(string2wstring(std::string(optPtr)));
   407 				throw CCommandParser::ECmdLineUnknownOption;
   407 				throw CCommandParser::ECmdLineUnknownOption;
   408 				}
   408 				}
   409 			}
   409 			}
   410 
   410 
   411 		if (err)
   411 		if (err)
   462 	std::string::const_iterator currentPos = it;
   462 	std::string::const_iterator currentPos = it;
   463     //
   463     //
   464 	while (currentPos != end)
   464 	while (currentPos != end)
   465 	    {
   465 	    {
   466 		currentPos = std::find(it, end, ',');
   466 		currentPos = std::find(it, end, ',');
   467 		std::wstring x;
   467 		std::wstring x = string2wstring(std::string(it,(currentPos-it)));
   468 		Utf8ToUcs2(std::string(it,(currentPos-it)), x);
       
   469 		//aOptionsList.push_back(x);
   468 		//aOptionsList.push_back(x);
   470 		(aParamList.*aFilePtr)(x);
   469 		(aParamList.*aFilePtr)(x);
   471 
   470 
   472 		if (currentPos == end)
   471 		if (currentPos == end)
   473 			{
   472 			{
   490 	currentPos = std::find(it, end, ',');
   489 	currentPos = std::find(it, end, ',');
   491 
   490 
   492 	while (currentPos != end)
   491 	while (currentPos != end)
   493 	    {
   492 	    {
   494 		currentPos = std::find(it, end, ',');
   493 		currentPos = std::find(it, end, ',');
   495 		std::wstring x;
   494 		std::wstring x = string2wstring(std::string(it,(currentPos-it)));
   496 		Utf8ToUcs2(std::string(it,(currentPos-it)), x);
       
   497 
   495 
   498 		InstallSISFile sisFileName(x, '$', false);
   496 		InstallSISFile sisFileName(x, '$', false);
   499 		aParamList.AddSISFile(sisFileName);
   497 		aParamList.AddSISFile(sisFileName);
   500 
   498 
   501 		if (currentPos == end)
   499 		if (currentPos == end)
   509 	
   507 	
   510 	// At this stage, aArgv could be something like: file.sis +e +mcard +sucert
   508 	// At this stage, aArgv could be something like: file.sis +e +mcard +sucert
   511 	// As the sisfile attributes are predetermined input, therefore we can just
   509 	// As the sisfile attributes are predetermined input, therefore we can just
   512 	// parse according to the predetermined inputs.
   510 	// parse according to the predetermined inputs.
   513 
   511 
   514 	std::wstring fileName;
   512 	std::wstring fileName = string2wstring(sisFileOption);
   515 	Utf8ToUcs2(sisFileOption, fileName);
       
   516 
   513 
   517 	InstallSISFile sisFileName(fileName, '$', false);
   514 	InstallSISFile sisFileName(fileName, '$', false);
   518 		
   515 		
   519 	while (--aArgc > 0)
   516 	while (--aArgc > 0)
   520 		{ // Process associated SIS file attributes
   517 		{ // Process associated SIS file attributes