secureswitools/swisistools/source/interpretsislib/stringutils.h
branchRCL_3
changeset 81 42552535c1ac
parent 62 5cc91383ab1e
equal deleted inserted replaced
73:79647526f98c 81:42552535c1ac
     1 /*
     1 /*
     2 * Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies).
     2 * Copyright (c) 2007-2009 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".
    33 
    33 
    34 // User includes
    34 // User includes
    35 #include "symbiantypes.h"
    35 #include "symbiantypes.h"
    36 
    36 
    37 // Constants
    37 // Constants
    38 #ifndef __TOOLS2_LINUX__
       
    39 const std::wstring KDirectorySeparator( L"\\" );
    38 const std::wstring KDirectorySeparator( L"\\" );
    40 const std::wstring KDoubleSlashPathPrefix( L"\\\\" );
       
    41 const std::string KDirectorySeparatorString( "\\" );
       
    42 const std::string KDoubleSlashPathPrefixString( "\\\\" );
       
    43 #else
       
    44 const std::wstring KDirectorySeparator( L"/" );
       
    45 const std::wstring KDoubleSlashPathPrefix( L"//" );
       
    46 const std::string KDirectorySeparatorString( "/" );
       
    47 const std::string KDoubleSlashPathPrefixString( "//" );
       
    48 #endif
       
    49 
    39 
    50 class StringUtils
    40 class StringUtils
    51 	{
    41 	{
    52 public:
    42 public:
    53 	static int FirstInvalidDirSeparatorSize(std::wstring& aPath, std::wstring::size_type& aIndex);
    43 	static int FirstInvalidDirSeparatorSize(std::wstring& aPath, std::wstring::size_type& aIndex);
    55     static std::string TrimWhiteSpace( const std::string& aString );
    45     static std::string TrimWhiteSpace( const std::string& aString );
    56     static bool CheckForMatch( const std::string& aSearchFor, std::string& aLine );
    46     static bool CheckForMatch( const std::string& aSearchFor, std::string& aLine );
    57     static std::string ToUpper( const std::string& aString );
    47     static std::string ToUpper( const std::string& aString );
    58 	static std::wstring ToUpper( const std::wstring& aString );
    48 	static std::wstring ToUpper( const std::wstring& aString );
    59 	static std::string ToLower( const std::string& aString );
    49 	static std::string ToLower( const std::string& aString );
    60 	static std::wstring ToLower( const std::wstring& aString );
       
    61     static bool IsLastCharacter( const std::wstring& aString, wchar_t aChar );
    50     static bool IsLastCharacter( const std::wstring& aString, wchar_t aChar );
    62     static bool StartsWithDrive( const std::wstring& aText );
    51     static bool StartsWithDrive( const std::wstring& aText );
    63     static std::wstring MakePathFromSID( const std::wstring& aBasePath, TUint32 aSID );
    52     static std::wstring MakePathFromSID( const std::wstring& aBasePath, TUint32 aSID );
    64 	static std::wstring BuildSisRegistryFileName( const int aIndex );
    53 	static std::wstring BuildSisRegistryFileName( const int aIndex );
    65 	static std::wstring BuildControllerFileName( const int aIndex, const int aCtlIndex);
    54 	static std::wstring BuildControllerFileName( const int aIndex, const int aCtlIndex);