testexecfw/useremul/src/Utils.cpp
changeset 0 3e07fef1e154
equal deleted inserted replaced
-1:000000000000 0:3e07fef1e154
       
     1 /*------------------------------------------------------------------
       
     2  -
       
     3  * Software Name : UserEmulator
       
     4  * Version       : v4.2.1309
       
     5  * 
       
     6  * Copyright (c) 2009 France Telecom. All rights reserved.
       
     7  * This software is distributed under the License 
       
     8  * "Eclipse Public License - v 1.0" the text of which is available
       
     9  * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
    10  *
       
    11  * Initial Contributors:
       
    12  * France Telecom 
       
    13  *
       
    14  * Contributors:
       
    15  *------------------------------------------------------------------
       
    16  -
       
    17  * File Name: Utils.cpp
       
    18  * 
       
    19  * Created: 13/08/2009
       
    20  * Author(s): Marcell Kiss, Reshma Sandeep Das
       
    21  *   
       
    22  * Description:
       
    23  * Utility class having helper functions 
       
    24  *------------------------------------------------------------------
       
    25  -
       
    26  *
       
    27  */
       
    28 
       
    29 // System Includes
       
    30 #include <aknutils.h>
       
    31 #include <rpbkviewresourcefile.h>
       
    32 #include <aknnotewrappers.h>
       
    33 
       
    34 // User Includes
       
    35 #include "Utils.h"
       
    36 
       
    37 void CUtils::MessageBoxL(const TDesC& aMessage)
       
    38 {
       
    39     CAknInformationNote* informationNote = new ( ELeave ) CAknInformationNote;
       
    40     informationNote->ExecuteLD( aMessage );
       
    41 }
       
    42     
       
    43 void CUtils::StripSpaces(TDes8& aText)
       
    44 	{
       
    45 	TInt i;
       
    46 	for (i=0; i<aText.Length(); i++)
       
    47 		if (aText[i] != ' ')
       
    48 			break;
       
    49 	if (i)
       
    50 		aText.Delete(0,i);
       
    51 	for (i=aText.Length()-1; i>=0; i--)
       
    52 		if (aText[i] != ' ')
       
    53 			break;
       
    54 	if (i != aText.Length()-1)
       
    55 		aText.Delete(i+1,aText.Length()-1-i);
       
    56 	}
       
    57 
       
    58 void CUtils::StripSpaces(TDes& aText)
       
    59 	{
       
    60 	TInt i;
       
    61 	for (i=0; i<aText.Length(); i++)
       
    62 		if (aText[i] != ' ')
       
    63 			break;
       
    64 	if (i)
       
    65 		aText.Delete(0,i);
       
    66 	for (i=aText.Length()-1; i>=0; i--)
       
    67 		if (aText[i] != ' ')
       
    68 			break;
       
    69 	if (i != aText.Length()-1)
       
    70 		aText.Delete(i+1,aText.Length()-1-i);
       
    71 	}